On Apr 7, 7:03 pm, Louis Santillan <[email protected]> wrote: > I prefer this JS based implementation > (http://github.com/visionmedia/js-mock-timers). Much simpler and only > requires wiring up a time source (the library uses a tick() method for > this). It's simple enough to be rewritten to use a usleep() based > call in a pseudo event loop.
For those of you who haven't look at that code yet, it's bad-ass. It abstracts away the passage of time to the client, who moves time forward by calling tick(milliSecondCount). That allows tricks like running animations in slow-motion by simply changing how the ticker function behaves (e.g. 50% speed by ticking at the same real interval but passing half of the real-time tick value). i am definitely going to replace my setTimeout() impl with that one, and i have renamed my threaded work-alikes to spawnTimeoutThread(), spawnIntervalThread(), ... Thanks again for that, Louis! That's the most interesting code i've seen in days or weeks :). -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users To unsubscribe, reply using "remove me" as the subject.
