W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2008

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

From: Geoffrey Garen <ggaren@apple.com>
Date: Fri, 3 Oct 2008 00:03:41 -0700
Message-Id: <F7DA1CA7-530E-4AE8-9765-8EC9C16103BC@apple.com>
To: public-webapps@w3.org
Cc: Maciej Stachowiak <mjs@apple.com>
> // 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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:28 GMT