Solved

A more accurate function then now

Posted on 2002-04-08
4
179 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
ID: 6925140
gettickcount()
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6925146
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
ID: 6925150
Wow! That was quick!
Thanks
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6925429
glad to helped you :-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to fill array with TArray.Create? 14 79
Find and Replace Stream with 0s 8 57
control image tags in a string ? 12 111
Firemonkey webbrowser scrollbars ? 1 29
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 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

16 Experts available now in Live!

Get 1:1 Help Now