• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 192
  • Last Modified:

A more accurate function then now

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
libbysharf
Asked:
libbysharf
  • 3
1 Solution
 
kretzschmarCommented:
gettickcount()
0
 
kretzschmarCommented:
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
 
libbysharfAuthor Commented:
Wow! That was quick!
Thanks
0
 
kretzschmarCommented:
glad to helped you :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now