Fix timers with interval greater than a second. r=blizzard

git-svn-id: svn://10.0.0.236/trunk@54538 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
tor%cs.brown.edu
1999-11-28 19:12:10 +00:00
parent 134197fc4f
commit 2ba35ab26e

View File

@@ -96,7 +96,11 @@ nsTimerXlib::Init(PRUint32 aDelay)
// get the cuurent time
gettimeofday(&Now, NULL);
mFireTime.tv_sec = Now.tv_sec + (aDelay / 1000);
mFireTime.tv_usec = Now.tv_usec + (aDelay * 1000);
mFireTime.tv_usec = Now.tv_usec + ((aDelay%1000) * 1000);
if (mFireTime.tv_usec >= 1000000) {
mFireTime.tv_sec++;
mFireTime.tv_usec -= 1000000;
}
//printf("fire set to %ld / %ld\n",
//mFireTime.tv_sec, mFireTime.tv_usec);
// set the next pointer to nothing.