-
Client Software Programmer
cleartimeout and read the ms left over before its stopped
Hi, I don't think as3 has this right, I wanted to clear my timeout and see the ms left so I can set a users ping based on when he should have arrived between the server/client
var myTimeout = setTimeout(trace,1100,"hey");
//lets say I clear timeout in "1000ms, I want to see there is 100ms left over"
clearTimeout(myTimeout);
-
I think that you have to use a separate timer. All I'm seeing is starting and stopping the timeout. Get Timer
-
Client Software Programmer
no only something from settimeout
-
If you look at adobe's docs for settimeout https://help.adobe.com/en_US/FlashPl...l#setTimeout(). There's no method for what you want. That's why I said you'd need something extra.
-
.
Hi,
As swak says there is no method purely using set time out.
You need to use get timer too.
So use two number or int vars. One when you call the timer and one when you stop it.
Then subtract the first from the second and format the ms into readable time format.
Fractions of seconds basically. Unless you want the answer in ms. A true second in ms is actually1024ms and not 1000.
-
Client Software Programmer
I feel like that other timer might be heavy though, running at all times and such
-
.
Hi,
Get timer is running from the very beginning of opening any swf. You just access the time when required
Ignore my 1024ms thing. Had other things on my plate
-
Client Software Programmer
its always off by some ms it gives different answers based on cpu load I think, 1100ms-1000ms = 32ms left over sometimes changes around that
-
.
Hi,
I think you just answered yourself. Of course things will vary with different CPUs and hardware etc etc
Perhaps avoid the set timeout just call get timer to start and get timer to finish.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|