[whatwg] Timing API proposal for measuring intervals

Roger Hågensen rescator at emsai.net
Fri Jul 8 05:47:41 PDT 2011

On 2011-07-08 12:32, Mark Callow wrote:
> On 08/07/2011 11:54, James Robinson wrote:
>> True.  On OS X, however, the CoreVideo and CoreAudio APIs are specified to
>> use a unified time base (see
>> http://developer.apple.com/library/ios/#documentation/QuartzCore/Reference/CVTimeRef/Reference/reference.html)
>> so if we do end up with APIs saying "play this sound at time X", like Chris
>> Roger's proposed Web Audio API provides, it'll be really handy if we have a
>> unified timescale for everyone to refer to.
> If you are to have any hope of synchronizing a set of media streams you
> need a common timebase. In TV studios it is called house sync. In the
> first computers capable of properly synchronizing media streams and in
> the OpenML specification it was called UST (Unadjusted System Time).
> This is the "monotonic uniformly increasing hardware timestamp" referred
> to in the Web Audio API proposal. Plus ça change. Plus ça même. For
> synchronization purposes, animation is just another media stream and it
> must use the same timebase as audio and video.
> Regards
>      -Mark

Agreed, and the burden of providing monotonic time lies on the OS (and 
indirectly the MB, HPET etc. or audio card or GPU clock or whatever the 
clock source is.)
So Browsers should only need to convert to/from (if needed) Double and 
OS highres time format (which should be there via a OS API in a modern OS).

Roger "Rescator" Hågensen.
Freelancer - http://www.EmSai.net/

More information about the whatwg mailing list