Skip to content

Instantly share code, notes, and snippets.

@tosuke
Created February 26, 2017 09:51
Show Gist options
  • Save tosuke/567e64997efd14dfb1099532fbbc8294 to your computer and use it in GitHub Desktop.
Save tosuke/567e64997efd14dfb1099532fbbc8294 to your computer and use it in GitHub Desktop.
eventcoreの実験
/+ dub.sdl:
name "eventcoretest"
dependency "eventcore" version="~>0.8.4"
+/
import eventcore.core;
import std.stdio;
import std.datetime;
import core.time;
void main() {
auto tm = eventDriver.timers.create();
eventDriver.timers.wait(tm, (tm) nothrow @safe {
try{
"hoge".writeln;
} catch(Exception e){}
});
eventDriver.timers.set(tm, 5.seconds, 0.seconds);
ExitReason er;
er = eventDriver.core.processEvents(Duration.max);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment