flat assembler
Message board for the users of flat assembler.

Index > Windows > curious about GetLocalTime

Author
Thread Post new topic Reply to topic
moriman



Joined: 01 Apr 2006
Posts: 55
Location: Northern Ireland
moriman
Hi,

Have been using GetLocalTime to test (and optimize) the speed of various parts of my code...

Code:
.
.
start_time      SYSTEMTIME
.
.
invoke  GetLocalTime, start_time
mov     ax, [start_time.wMilliseconds]
.
.
    


I have found that the wMilliseconds component is always a multiple of ten¿
How come it never returns single milliseconds?

I know it's not earth-shatteringly important, but I'm just a tad curious Wink

tia

mori
Post 09 Apr 2006, 17:22
View user's profile Send private message Reply with quote
UCM



Joined: 25 Feb 2005
Posts: 285
Location: Canada
UCM
probably windows sets the timer to 100Hz or something...
but ask them, not me Wink
Post 09 Apr 2006, 18:16
View user's profile Send private message Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
i code the following to test what you mentioned.
but i got wMilliseconds not always multiple of ten

in my test, it returned single milisecond, ~ 6 :p

you could get my source + binary and try run on your machine.
btw, nlited winxp (gold) here.

http://sulaiman.netadvant.com/fasm/t1.zip
Post 09 Apr 2006, 19:34
View user's profile Send private message Visit poster's website Reply with quote
moriman



Joined: 01 Apr 2006
Posts: 55
Location: Northern Ireland
moriman
maybe there is some difference when using it under windoze as opposed to dos¿
Post 09 Apr 2006, 20:09
View user's profile Send private message Reply with quote
RedGhost



Joined: 18 May 2005
Posts: 443
Location: BC, Canada
RedGhost
you can always use GetTickCount
Quote:
Retrieves the number of milliseconds that have elapsed since the system was started


initial_time = GetTickCount( )

;;;;;

time_elapsed = GetTickCount( )-initial_time

_________________
redghost.ca
Post 09 Apr 2006, 20:16
View user's profile Send private message AIM Address MSN Messenger Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
check things like LocalTimeToFileTime or whatever it is called, "file time" is 64bit number counting some 10000000s of second (not sure about the constant, it is 100s of nanoseconds).

you can find it somehow Smile
Post 09 Apr 2006, 21:45
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.