HZGN.COM
welcome to my space
X
Search:  
Welcome to:hzgn.com
Feng Shui | Graphic Design | Cosmetics | Causes and Organizations | Regulatory Compliance | Gadgets and Gizmos | Computer Forensics | Tools and Equipment | Related articles
 HOME   setInterval argument

setInterval argument

Published by: smith 2009-01-07

Firefox sets the last argument of the callback called from setInterval to the how late the callback is in milliseconds. It occurred to me that this could be used to calculate the offset from beginning of animation in correctFrame, instead of calling new Date() every time. I thought this may be a performance enhancement.

JavaScript Frame object::
setInterval() method of frame object is used to call a function of JavaScript or to evaluate an expression after the time interval specified in arguments
http://www.exforsys.com/tutorials/javascript/javascript-frame-object.html
HOME

I created a patch to ext-base.js that uses this argument.

It doesn't seem to have made much difference, but I thought I would post it here.
FlashSupport.com - NEW setInterval() and clearInterval()::
5 posts - 2 authors - Last post: Jan 15, 2006myInterval = setInterval(move, 50, circle); This code will execute the move() function every 50 milliseconds, passing it the argument circle
http://www.flashsupport.com/forum/topic.asp?TOPIC_ID=79
HOME
Feel free to benchmark it and come to your own conclusions.

--- source/adapter/ext-base.js.orig 2007-11-13 12:32:54.118454600 -0800
+++ source/adapter/ext-base.js 2007-11-13 12:38:00.434875400 -0800
@@ -1624,19 +1623,23 @@
};


- this.run = function() {
+ this.run = function(late) {
for (var i = 0, len = queue.length; i < len; ++i) {
var tween = queue[i];
if (!tween !tween.isAnimated()) {
continue;
}
-
+
if (tween.currentFrame < tween.totalFrames tween.totalFrames === null)
{
tween.currentFrame += 1;

if (tween.useSeconds) {
- correctFrame(tween);
+ if(Ext.isGecko){
+ correctFrame(tween, late);
+ }else{
+ correctFrame(tween);
+ }
}
tween._onTween.fire();
}
@@ -1655,12 +1658,25 @@
return -1;
};

-
- var correctFrame = function(tween) {
+
+ var correctFrame = function(tween, late, state) {
var frames = tween.totalFrames;
var frame = tween.currentFrame;
var expected = (tween.currentFrame * tween.duration * 1000 / tween.totalFrames);
- var elapsed = (new Date() - tween.getStartTime());
+ var elapsed;
+ if (Ext.isGecko){
+ if (tween.currentFrame === 1 ) {
+ tween.elapsed = 0;
+ //firefox has a minium of 10 milliseconds
+ tween.delay = Ext.lib.AnimMgr.delay < 10?10:Ext.lib.AnimMgr.delay;
+ }
+ tween.elapsed += tween.delay + late;
+ elapsed = tween.elapsed;
+ } else {
+ elapsed = (new Date() - tween.getStartTime());
+ }
+
+
var tweak = 0;

if (elapsed < tween.duration * 1000) {


Red Hat's Rough Recovery From CFO Exit
Windows Live Finds a New, Pre-installed Home

PRINT Add to favorites
  • pain in arms upon sneezing or other activity
  • aol users version number
  • preparing a webtv unit for re sale
  • simple monitor repair question
  • grammar pronunciation writing of large numbers i e 2003
  • tiffany diamond engagement ring
  • finding email address for the person at url 199 106 212 15
  • science cloning
  • age
  • computer help
  • getting rid of a dual boot environment on my computer
  • girls school
  • sony digital camera software
  • dates of birth
  •  
  • spiderman pc game stuck at green gobline
  • birth place of st kitts imigrant
  • famous last words
  • web site hosting companies are there any objective rankings
  • snap on diagnostic tool
  • minidisc music to cd 39 s
  • need proffesional assistance on a website
  • microsoft publisher files
  • how to change bmp files to true vector eps file
  • clearing search categories from my browser
  • buying a new pc which is the best to get for my needs
  • hpscanner4300c
  • henry rollins video
  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about setInterval argument , Please add it free.

    About us -Site map -Advertisement -Jion us -Contact usExchange linksSponsor us
    Copyright© 2008 hzgn.com All Rights Reserved
    Site made&Support support@hzgn.com    E-mail: web@hzgn.com