views:

47

answers:

1

I'm looking to build a program that works within soft real-time schedules; to do this, I need to generate a timing event at an interval significantly less than a second.

Is there an API that exposes fine-grain timers in WebOS?

+1  A: 

You can use the DOM API setTimeout() to have a function be called back in the future. The timing is specified in milliseconds. Your callback will be called at least that many milliseconds after the call to setTimeout, but it could be longer if other JS code is running, since the Javascript engine won't interrupt running code to call your function.

Ben Combee