Skip to content

Instantly share code, notes, and snippets.

View tebjan's full-sized avatar
🌻
Focusing

Tebjan Halm tebjan

🌻
Focusing
View GitHub Profile
@tebjan
tebjan / BusyWait.cs
Created September 20, 2018 15:18
.NET high precision busy wait timer
while (running && Mode == TimerMode.Periodic)
{
var t = stopwatch.Elapsed;
var remainingTime = FInterval - (t - FOldTime);
if (remainingTime.Ticks > 2)
{
//if there is more time left than the wait accuracy
if (remainingTime.Ticks > FWaitAccuracy.Ticks)
{
@tebjan
tebjan / mkbundle_cygwin.sh
Last active February 20, 2021 09:20 — forked from shilrobot/package.sh
Updated script as of May 2013 to compile a Mono/.NET C# application into a native executable using mono's mkbundle with cygwin on Windows. Please comment if something does not work or you have an idea for improvement. Now with icon support.
#!/bin/bash
#
#Usage:
#1.) Install cygwin and make sure you select the following packages:
#- gcc-mingw
#- pkg-config
#- mingw-zlib1
#- mingw-zlib-devel
#
#2.) Install the following Mono release package: "Mono for Windows, Gtk#, and XSP"