Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
15 lines (12 sloc) 312 Bytes
#library('server-utils');
#import('dart:isolate');
time(msg, callback()) {
var sw = new Stopwatch.start();
callback();
sw.stop();
print('Timing for $msg: ${sw.elapsedInUs()} us');
}
// runs the callback on the event loop at the next opportunity
queue(callback()) {
new Timer(0, (t) => callback());
}