Thread View: borland.public.delphi.basm
6 messages
6 total messages
Started by luo
Wed, 11 Sep 2002 07:38
GetTickCount vs. Now, which faster?
Author: luo
Date: Wed, 11 Sep 2002 07:38
Date: Wed, 11 Sep 2002 07:38
14 lines
1357 bytes
1357 bytes
i want write a lot of action into a log file, now i use function "now " to record the time, but the action sometimes recorded in the same time , for examply: 2002-09-09 12:20:30 action1 2002-09-09 12:20:30 action2 if i want to know which is earlier, i can use GetTickCount to replace function now. all i want to know is: does GetTickCount use system resource less than function now, or more than function now? sorry for my poor english. thanks a lot!
Re: GetTickCount vs. Now, which faster?
Author: Irawan Tanudirdjo
Date: Wed, 11 Sep 2002 07:54
Date: Wed, 11 Sep 2002 07:54
12 lines
1377 bytes
1377 bytes
Shallom, > all i want to know is: does GetTickCount use system resource less than > function now, or more than function now? I think GetTickCount uses the least resource cause it is a WinAPI function. But, in my opinion, if you use function Now, its precision is low because Now only returns a TDateTime, but if you use GetTickCount it returns miliseconds (for me it is more accurate). Hope this helps. Living in JESUS grace, Irawan T.
Re: GetTickCount vs. Now, which faster?
Author: Rod Rishworth
Date: Wed, 11 Sep 2002 08:03
Date: Wed, 11 Sep 2002 08:03
14 lines
1594 bytes
1594 bytes
> if i want to know which is earlier, i can use GetTickCount to replace
> function now.
The earlier one will be first in the file, assuming you are simply
appending.
> all i want to know is: does GetTickCount use system resource less than
> function now, or more than function now?
The Now function calls GetLocalTime, EncodeDate and EncodeTime
(including milliseconds). You are probably using FormatDateTime('c',
Now), which will always be more expensive than IntToStr(GetTickCount).
If you want milliseconds, try 'yyyy-mm-dd hh:nn:ss.zzz' as your format.
Re: GetTickCount vs. Now, which faster?
Author: ADS
Date: Wed, 11 Sep 2002 08:42
Date: Wed, 11 Sep 2002 08:42
20 lines
1474 bytes
1474 bytes
You will have more precision with gettickcount. > i want write a lot of action into a log file, now i use function "now " to > record the time, but the action sometimes recorded in the same time , for > examply: > 2002-09-09 12:20:30 action1 > 2002-09-09 12:20:30 action2 > if i want to know which is earlier, i can use GetTickCount to replace > function now. > > all i want to know is: does GetTickCount use system resource less than > function now, or more than function now? > > sorry for my poor english. > > thanks a lot! > >
Re: GetTickCount vs. Now, which faster?
Author: Andy Hill
Date: Wed, 11 Sep 2002 08:47
Date: Wed, 11 Sep 2002 08:47
18 lines
1371 bytes
1371 bytes
> all i want to know is: does GetTickCount use system resource less than > function now, or more than function now? > > sorry for my poor english. > > thanks a lot! Hi, You could try looking at: QueryPerformanceFrequency QueryPerformanceCounter -- Andy Hill. Quidquid latine dictum sit, altum sonatur.
Re: GetTickCount vs. Now, which faster?
Author: luo
Date: Thu, 12 Sep 2002 03:33
Date: Thu, 12 Sep 2002 03:33
20 lines
1688 bytes
1688 bytes
thanks a lot! i will use gettickcout then. "luo" <mercedesbenz@21cn.com> д����Ϣ���� :3d7ef378@newsgroups.borland.com... > i want write a lot of action into a log file, now i use function "now " to > record the time, but the action sometimes recorded in the same time , for > examply: > 2002-09-09 12:20:30 action1 > 2002-09-09 12:20:30 action2 > if i want to know which is earlier, i can use GetTickCount to replace > function now. > > all i want to know is: does GetTickCount use system resource less than > function now, or more than function now? > > sorry for my poor english. > > thanks a lot! > >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads