W3C home > Mailing lists > Public > public-webrtc@w3.org > May 2015

Re: New functionality in PR - priority

From: Jan-Ivar Bruaroey <jib@mozilla.com>
Date: Sun, 24 May 2015 22:19:00 -0400
Message-ID: <55628694.3080907@mozilla.com>
To: Eric Rescorla <ekr@rtfm.com>
CC: Peter Thatcher <pthatcher@google.com>, Harald Alvestrand <harald@alvestrand.no>, "public-webrtc@w3.org" <public-webrtc@w3.org>
On 5/24/15 4:15 PM, Eric Rescorla wrote:
> On Sun, May 24, 2015 at 6:41 AM, Jan-Ivar Bruaroey <jib@mozilla.com 
> <mailto:jib@mozilla.com>> wrote:
>
>     Keep in mind that JavaScript is essentially a bunch of callbacks,
>     none of which are allowed to take any appreciable amount of time,
>     or indeed even observe the passage of time.
>
>
> I don't understand this claim. Content JS can chew up huge amounts of 
> time, though of course
> eventually the browser will start to complain about the thread being 
> stalled.
>
> As far as observe the passage of time, consider the following code:
> var d1;
> var d2;
>
> d1 = new Date();
> d2 = new Date();
>
> while (d2.getTime() == d1.getTime()){
>   d2 = new Date();
> }
>
> alert("d1=" + d1.getTime() + " d2=" + d2.getTime());
>
> Is it your claim that the loop never terminates?

It does terminate, as it looks like you can observe the machine clock (I 
guess it'd be hard to time things accurately otherwise).

But AFAIK you can't observe much else. Try observing video.currentTime 
of a gum stream: http://jsfiddle.net/r79L3j05

I tried in Chrome and Firefox and video.currentTime doesn't observably 
advance while JS is executing.

.: Jan-Ivar :.
Received on Monday, 25 May 2015 02:19:32 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:44 UTC