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?


* 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  

* Distinguishes itself better from the old setTimeout / setInterval  

> 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.

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

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:12 UTC