actionscript - Wildly inaccurate timing in Flash? -
I am creating a tool in Flash to tell me to load a server's content slightly How much time I am doing
foo = new date (). GetTime (); // object bar = get new date (). GetTime (); Trace (bar-foo); However, in any case, time is only 3ms to 150ms, very upheaval. When I test it using python, time is around 5 mms continuously. Does anyone know what is happening and how do I fix it ?! Thanks a lot!
This is due to Flash players asynchronous execution model
Then in Python you will naturally do some synchronous kind:
var foo = now (); Var data = load data (); Var Bar = now (); In AS 3
it is more like:
var foo = now (); IoThread.addJob (load data, function (data) {var bar = now ()});
Or even in the browser, IO jobs are done by the browser. But in any case, it is very lazy, maybe based on the assumption that the bandwidth required interruption is.
Congratulations - back 2ds
Comments
Post a Comment