Article View: borland.public.cppbuilder.nativeapi
Article #15822Re: GetTickCount() Example
From: Martin Moeller
Date: Fri, 13 Jun 2003 20:26
Date: Fri, 13 Jun 2003 20:26
28 lines
2035 bytes
2035 bytes
"Greg Stantin" <gstantin@stantonassoc.com> ha scritto nel messaggio news:3ee9e239@newsgroups.borland.com... > Does anyone have a working example of GetTickCount() that > shows the returned value if the form of hh:mm:ss 00:00:00. I > am trying to do a time elapsed piece of code, i have seen it in > so many other pieces of software. Can somone help me out > with this. > Look, I'm still an awfull BCB programmer , but TickCounts are milliseconds, thus (all untested): unsigned long ElapsedTicks=500; // to round +-1 sec if(StartTicks<EndTicks) ElapsedTicks+=(EndTicks-StartTicks); else ElapsedTicks+=(EndtTicks+(0xFFFFFFFF-StartTicks)); // minimum time is 1 second ElapsedTicks/=1000; // call/insert for 00:00:00 format AnsiString(String((ElapsedTicks/(60*60))+":"+String((ElapsedTicks/60)%60)+": "+String(ElapsedTicks%60)); Whereby I hope to remember corrrectly that % is the div mod operator. Rgds, Martin
Technical Details
Message-ID:
<3eea3389$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!out.nntp.be!propagator2-sterling!news-in-sterling.newsfeed.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3ee9e239@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,aacf7a7643439ceb X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-06-13 13:33:05 PST Reply-To: "Martin Moeller" <martin.moeller@moema.it> From: "Martin Moeller" <martin.moeller@moema.it> Newsgroups: borland.public.cppbuilder.nativeapi References: <3ee9e239@newsgroups.borland.com> Subject: Re: GetTickCount() Example Date: Fri, 13 Jun 2003 22:26:47 +0200 Lines: 30 Organization: Moe.Ma Italiana Srl X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 213.45.0.170 Message-ID: <3eea3389$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1055536009 213.45.0.170 (13 Jun 2003 13:26:49 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!out.nntp.be!propagator2-sterling!news-in-sterling.newsfeed.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail