Re: Proposal: High resolution (and otherwise improved) timer API

> // should be implemented by Window objects
> interface WindowTimer {
>      Timer startTimer(in double delayInSeconds, in boolean repeating,
> in TimerHandler handler);
> }

How about a "Timer" constructor function instead?

Pros:

* Fits the object-oriented programming model of "new Image", "new  
XMLHttpRequest", etc.

* Enables use of object-oriented features like instanceof,  
the .constructor property, and prototype-based extensions to timer  
objects.

* Distinguishes itself better from the old setTimeout / setInterval  
functions.

> readonly attribute double timeElapsed; // time in seconds since
"elapsedTime" reads better to me, since it makes "elapsed" definitely  
an adjective, and not a verb.

Overall, I think this is a great proposal.

Cheers,
Geoff

Received on Friday, 3 October 2008 07:06:05 UTC