timing on win

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

timing on win

Post by HPW »

On WIN2K:

Code: Select all

newLISP v.8.2.1 Copyright (c) 2004 Lutz Mueller. All rights reserved.

> (time(sleep 10))
10
> (time(sleep 100))
100
> (time(sleep 1000))
1001
> (time(sleep 10000))
10004
> (time(sleep 100000))
100004
> 
On WINXP (some MHZ feaster):

Code: Select all

newLISP v.8.2.1 Copyright (c) 2004 Lutz Mueller. All rights reserved.

> (time(sleep 10))
16
> (time(sleep 100))
94
> (time(sleep 1000))
1000
> (time(sleep 10000))
10000
> (time(sleep 100000))
100000
> 
Strange?
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

not strange it all, it depends on the time granularity of your OS's scheduler, system load, priority status of you app., etc.

This is on XP home edition:

> (time (sleep 10))
16
> (time (sleep 100))
109
> (time (sleep 1000))
1000
> (time (sleep 1000))


On FreeBSD:

> (time (sleep 10))
20
> (time (sleep 100))
107
> (time (sleep 1000))
1003
>

and numbers are never the same if you repeat, so don't worry

Lutz

Locked