Solved

A more accurate function then now

Posted on 2002-04-08
4
178 Views
Last Modified: 2010-04-04
Hello,
I want to measure the cpu time for a function.

Right now I'm using the function "now" as in:

edit2.text:=timetostr(now);

Obviously I need something more accurate.

Does anyone have any idea?


0
Comment
Question by:libbysharf
  • 3
4 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 30 total points
Comment Utility
gettickcount()
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
means


var
  start, stop, elapsed : Integer;
begin
  start := gettickcount;
  //call your function here
  stop := gettickcount;
  elapsed := stop-start;
  edit1.text := inttostr(elapsed) + ' ms'; //in milliseconds
end;

just from head,
typos possible

meikl ;-)
0
 

Author Comment

by:libbysharf
Comment Utility
Wow! That was quick!
Thanks
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
glad to helped you :-)
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now