Created
February 26, 2017 09:51
-
-
Save tosuke/567e64997efd14dfb1099532fbbc8294 to your computer and use it in GitHub Desktop.
eventcoreの実験
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/+ 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