summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2011-02-26 12:54:56 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2011-02-26 12:54:56 +0000
commit6eb8783632c53b212ca2244461e3de378800fc2e (patch)
treeaf88e679a361f43710fa64cbc7ed66ab719b50b0 /amiga
parent8b1a36e2dbe6930e4d166327e564d2420eb0febe (diff)
downloadnetsurf-6eb8783632c53b212ca2244461e3de378800fc2e.tar.gz
netsurf-6eb8783632c53b212ca2244461e3de378800fc2e.tar.bz2
Less ridiculous time calculation
svn path=/trunk/netsurf/; revision=11826
Diffstat (limited to 'amiga')
-rwxr-xr-xamiga/schedule.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/amiga/schedule.c b/amiga/schedule.c
index 030ed266a..0be34bbe8 100755
--- a/amiga/schedule.c
+++ b/amiga/schedule.c
@@ -51,18 +51,15 @@ void schedule(int t, void (*callback)(void *p), void *p)
{
struct nscallback *nscb;
struct timeval tv;
+ ULONG time_us = 0;
nscb = AllocVec(sizeof(struct nscallback), MEMF_PRIVATE | MEMF_CLEAR);
if(!nscb) return;
- nscb->tv.Seconds = 0;
- nscb->tv.Microseconds = t*10000;
+ time_us = t*10000; /* t converted to Ás */
- while(nscb->tv.Microseconds >= 1000000)
- {
- nscb->tv.Seconds++;
- nscb->tv.Microseconds -= 1000000;
- }
+ nscb->tv.Seconds = time_us / 1000000;
+ nscb->tv.Microseconds = time_us % 1000000;
GetSysTime(&tv);
AddTime(&nscb->tv,&tv); // now contains time when event occurs