Board index » delphi » TimerCount
Edmund Lau
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
|
Edmund Lau
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
TimerCount
hi, anyone who can show me how to make use of the TimerCount function in the
HELPTOOL unit to measure the execution time of a task, please help. How to include HELPTOOL unit in the source application? your reply would be most appreciated. |
Heinric
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:TimerCountQuoteEdmund Lau wrote in message <8caglk$u...@newton.pacific.net.sg>... I have no idea what this HELPTOOL is but here is how to access the clock counter. just declare: This value will increase at a rate of 18.2 Hz tilll midnight when it resets. Chaou Check my web-site: |
Dr John Stockto
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:TimerCountJRS: In article <8ckmce$lm...@ctb-nnrp1.saix.net> of Fri, 7 Apr 2000 14:54:14 seen in news:comp.lang.pascal.borland, Heinrich Quote<n...@worldonline.co.za> wrote: atomically, for otherwise there is an hourly risk of an hour's error. See <URL: http://www.merlyn.demon.co.uk/pas-time.htm#Atom>. TP & BP read longints a word at a time. -- |
Osmo Ronkan
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:TimerCountIn article <6KrSu4Dp0j74E...@merlyn.demon.co.uk>, Dr John Stockton <j...@merlyn.demon.co.uk> wrote: Quote>JRS: In article <8ckmce$lm...@ctb-nnrp1.saix.net> of Fri, 7 Apr 2000 two same values: Function Clock:longint; Osmo |
Dr John Stockto
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:TimerCountJRS: In article <8cmqnu$g2...@kruuna.Helsinki.FI> of Sat, 8 Apr 2000 11:30:54 seen in news:comp.lang.pascal.borland, Osmo Ronkanen Quote<ronka...@cc.helsinki.fi> wrote: question, in a section linked from within #Atom, with acknowledgement to yourself and Franz Glaser. -- |
stude
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:TimerCountOn Sat 08 Apr 2000 02:17:21p, In article <8fNDLJFxe374E...@merlyn.demon.co.uk>, j...@merlyn.demon.co.uk (Dr John QuoteStockton) wrote: following code: call PROGRAM.CLOCK ...all just to read the DWORD at $40:$6C The following function is superior to any of the methods presented. function GetClock: longint; If the above isn't in the FAQ, it ought to be. |
Osmo Ronkan
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:TimerCountIn article <8F10E12A0stud...@207.211.168.82>, Quotestudent <stud...@spam.me.not> wrote: readable to anyone. Your code could do anything. One needs to check it with de{*word*81} first. What if you want to convent the code to PM and use Seg0040 instead. Which is easier to convert. Also remember that messing with the interrupt flag is not the fastest You can use the same system with ASM also: Function clock:longint; assembler; That is faster than your method, especially if one writes it with inline. Osmo |
stude
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:TimerCountOn Sun 09 Apr 2000 04:58:32a, In article <8cpgno$hp...@kruuna.Helsinki.FI>, ronka...@cc.helsinki.fi (Osmo Ronkanen) wrote: Quote>>The following function is superior to any of the methods presented. Quote>How hurry are you to read the timer count? Quote>My code is readable to anyone. Quote>Your code could do anything. read the DWORD at $40:$6c atomically. Quote>One needs to check it happily ever after. Quote>What if you want to convent the code to PM and use Quote
generates a function call. It's easy enough to test it you want to take issue with my claim. But secondly, and more importantly, your code has a very {*word*193} latent bug. |
Osmo Ronkan
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:TimerCountIn article <8F11A16D9stud...@207.211.168.82>, Quotestudent <stud...@spam.me.not> wrote: Quote
Quote
Quote
Also you are picking the irrelevant. One could write that also with inline code. Quote> It's easy enough to test it you want to Please explain in detail. Do you mean that during midnight it could give Note that even with plain simple read with no control the chance of Here is how an error could occur: The code is executed between at 23:59:50.28. The value at that moment is In anyway that can easily be fixed: Function clock:longint; assembler; Of course you could generate a theory that makes even that fail but now For 100% certainty one should check for illegal values: Function clock:longint; assembler; Osmo |