BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GetTickCount
Goto page 1, 2  Next
 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
Leo
Guest





PostPosted: Sat Jan 17, 2004 4:00 pm    Post subject: GetTickCount Reply with quote



Hi,
In Visual Basic 6, i know the function GetTickCount.

But what is the same, in Delphi ?


--
Amicalement,
Leo
---------------------------------------------
Pour les riders, BMX, VTT. Un seul site :
Little Big Trail : http://perso.wanadoo.fr/lbt/
---------------------------------------------


Back to top
Maarten Wiltink
Guest





PostPosted: Sat Jan 17, 2004 4:18 pm    Post subject: Re: GetTickCount Reply with quote



"Leo" <giorgi.leonello (AT) wanadoo (DOT) fr> wrote


Quote:
In Visual Basic 6, i know the function GetTickCount.

But what is the same, in Delphi ?

GetTickCount.

Groetjes,
Maarten Wiltink



Back to top
Nicholas Sherlock
Guest





PostPosted: Sun Jan 18, 2004 2:06 am    Post subject: Re: GetTickCount Reply with quote



Maarten Wiltink wrote:
Quote:
"Leo" <giorgi.leonello (AT) wanadoo (DOT) fr> wrote in message
news:bublvf$fm3$1 (AT) news-reader3 (DOT) wanadoo.fr...

In Visual Basic 6, i know the function GetTickCount.

But what is the same, in Delphi ?

GetTickCount.

Groetjes,
Maarten Wiltink

Lol! :)

Cheers,
Nicholas Sherlock



Back to top
Leonardo C. Monteiro
Guest





PostPosted: Sun Jan 18, 2004 3:18 am    Post subject: Re: GetTickCount Reply with quote

Salut Leo,

GetTickCount is a Windows API function so you can use it in Delphi too. But
take care because the time will wrap around to zero if the system is run
continuously for 49.7 days. If you want to use it in a server application it
could be a problem.

À bientôt,

Leonardo.

"Leo" <giorgi.leonello (AT) wanadoo (DOT) fr> wrote

Quote:
Hi,
In Visual Basic 6, i know the function GetTickCount.

But what is the same, in Delphi ?


--
Amicalement,
Leo
---------------------------------------------
Pour les riders, BMX, VTT. Un seul site :
Little Big Trail : http://perso.wanadoo.fr/lbt/
---------------------------------------------





Back to top
Martin Harvey (Demon Acco
Guest





PostPosted: Mon Jan 19, 2004 3:34 am    Post subject: Re: GetTickCount Reply with quote

On Sun, 18 Jan 2004 00:18:02 -0300, "Leonardo C. Monteiro" <cardoso AT
iis.com.br> wrote:

Quote:
GetTickCount is a Windows API function so you can use it in Delphi too. But
take care because the time will wrap around to zero if the system is run
continuously for 49.7 days.


This, of course, isn't a problem under Windows 95 ;-)

MH.

Back to top
David Reeve
Guest





PostPosted: Mon Jan 19, 2004 1:43 pm    Post subject: Re: GetTickCount Reply with quote


"Bjørge Sæther" <bjorge (AT) hahaha_itte (DOT) no> wrote

Quote:
Martin Harvey (Demon Account) wrote:
On Sun, 18 Jan 2004 00:18:02 -0300, "Leonardo C. Monteiro" <cardoso AT
iis.com.br> wrote:

GetTickCount is a Windows API function so you can use it in Delphi
too. But take care because the time will wrap around to zero if the
system is run continuously for 49.7 days.


This, of course, isn't a problem under Windows 95 ;-)

Most software vendors solve this by ensuring their applications won't
allow
a computer to run for 49.7 days.


That's funny, I didn't think it took any special effort on the part of the
vendor :-)



Back to top
Leonardo C. Monteiro
Guest





PostPosted: Mon Jan 19, 2004 5:00 pm    Post subject: Re: GetTickCount Reply with quote

"Martin Harvey (Demon Account)" <martin (AT) _nospam_pergolesi (DOT) demon.co.uk> wrote
in message news:20ul00d9okfac78v4tvkbp28lidmv0bffu (AT) 4ax (DOT) com...
Quote:
On Sun, 18 Jan 2004 00:18:02 -0300, "Leonardo C. Monteiro" <cardoso AT
iis.com.br> wrote:

GetTickCount is a Windows API function so you can use it in Delphi too.
But
take care because the time will wrap around to zero if the system is run
continuously for 49.7 days.


This, of course, isn't a problem under Windows 95 Wink

Oh yeah :-)

Leonardo.



Back to top
Jamie
Guest





PostPosted: Tue Jan 20, 2004 10:01 am    Post subject: Re: GetTickCount Reply with quote

Quote:
GetTickCount is a Windows API function so you can use it in Delphi
too. But take care because the time will wrap around to zero if the
system is run continuously for 49.7 days.


This, of course, isn't a problem under Windows 95 ;-)

Most software vendors solve this by ensuring their applications won't

allow

a computer to run for 49.7 days.



That's funny, I didn't think it took any special effort on the part of the
vendor :-)

We must be talking about winders!

:)


Back to top
Phenton
Guest





PostPosted: Tue Jan 20, 2004 4:26 pm    Post subject: Re: GetTickCount Reply with quote

On Tue, 20 Jan 2004 11:32:12 +0100, "Bjørge Sæther"
<bjorge (AT) hahaha_itte (DOT) no> wrote:

Quote:
Leonardo C. Monteiro wrote:
"Martin Harvey (Demon Account)"
[email]martin (AT) _nospam_pergolesi (DOT) demon.co.uk[/email]> wrote in message
news:20ul00d9okfac78v4tvkbp28lidmv0bffu (AT) 4ax (DOT) com...
On Sun, 18 Jan 2004 00:18:02 -0300, "Leonardo C. Monteiro" <cardoso
AT iis.com.br> wrote:

GetTickCount is a Windows API function so you can use it in Delphi
too. But take care because the time will wrap around to zero if the
system is run continuously for 49.7 days.


This, of course, isn't a problem under Windows 95 ;-)

Oh yeah :-)

Did a Win95 machine *ever* run for 49.7 days, even when only running...Win95
?

A ex-work colleague once said he had Win95 running continuously for 3
days without some fatal Kernel error.

.......Saying that, he heard voices, reckoned he could levitate,
mentioned aliens had visited him and made his dog "Rover" King of
planet Thwog. I last heard he was on a mission to push a monkey nut
around Antarctica using only his nose. ;o)

Phenton

Back to top
Rob Kennedy
Guest





PostPosted: Tue Jan 20, 2004 7:00 pm    Post subject: Re: GetTickCount Reply with quote

"Bj������������������������������������" wrote:
Quote:
Did a Win95 machine *ever* run for 49.7 days, even when only running...Win95
?

Actually, I have a Windows 95 computer that I think has been running
since at least before Christmas. I'll check what GetTickCount returns
when I go home tonight.

We don't turn that computer off since it often takes several attempts
over the course of a half hour to boot up again, and then only one of
the two hard drives might be recognized. Time to replace it? Yes. But
what's that got to do with anything?

--
Rob

Back to top
Rob Kennedy
Guest





PostPosted: Wed Jan 21, 2004 6:02 am    Post subject: Re: GetTickCount Reply with quote

Rob Kennedy wrote:
Quote:
I'll check what GetTickCount returns when I go home tonight.

46.17 days. Almost there...

--
Rob

Back to top
Bruce Roberts
Guest





PostPosted: Wed Jan 21, 2004 11:20 pm    Post subject: Re: GetTickCount Reply with quote


"Bjørge Sæther" <bjorge (AT) hahaha_itte (DOT) no> wrote


Quote:
...and of course, one day it was stuck. I told them to wait, as it would
possibly break out of the loop after another 49.7 days Wink

Obviously, another critical app. LOL.



Back to top
Martin Harvey (Demon Acco
Guest





PostPosted: Thu Jan 22, 2004 10:44 pm    Post subject: Re: GetTickCount Reply with quote

On Wed, 21 Jan 2004 00:02:22 -0600, Rob Kennedy <me (AT) privacy (DOT) net>
wrote:

Quote:
46.17 days. Almost there...

Let us know what happens - I'm quite curious :-)

MH.

Back to top
Dragon Lord
Guest





PostPosted: Wed Jan 28, 2004 8:59 pm    Post subject: Re: GetTickCount Reply with quote

GetTickCount()

or if you want to be daring.


function GetMyCPUTicks(): Int64;
asm
XOR EAX, EAX
CPUID
RDTSC
end;


Yeah the DB is becuase the Delphi Inline Assembler doesn't support RDTSC

Depending on your "version" of delphi though, the inline assembler doesn't
work on RDTSC but you can replace that with "DB $0F, $31"

I use GetMyCPUTicks for my delphi code profiler

"Leo" <giorgi.leonello (AT) wanadoo (DOT) fr> wrote

Quote:
Hi,
In Visual Basic 6, i know the function GetTickCount.

But what is the same, in Delphi ?


--
Amicalement,
Leo
---------------------------------------------
Pour les riders, BMX, VTT. Un seul site :
Little Big Trail : http://perso.wanadoo.fr/lbt/
---------------------------------------------





Back to top
AlanGLLoyd
Guest





PostPosted: Fri Jan 30, 2004 6:51 am    Post subject: Re: GetTickCount Reply with quote

In article <101g8jus6cqp9a8 (AT) corp (DOT) supernews.com>, "Dragon Lord"
<invalid (AT) joke (DOT) com> writes:

Quote:
function GetMyCPUTicks(): Int64;
asm
XOR EAX, EAX
CPUID
RDTSC
end;


If you're doing any timing, then AIUI there is an issue with CPUID which causes
a variable time for CPUID to execute. This affects the overhead calculation,
and Intel recommends that CPUID is called three times with the overhead
calculation being done from the second to the third call.

Jim Hargis posted a full explanation in 2000. I have a copy if any one would
like it. And also an implementation into a unit, which enables a timer with
simple calls to time and display in various units.

Alan Lloyd
[email]alanglloyd (AT) aol (DOT) com[/email]

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.