PDA

View Full Version : Second counter.



NewsArchive
05-11-2012, 02:01 AM
Is it possible to integrate a clock?

Second counter.

To find out how long to develop in a loop or something else needs to
finish it.

Dirk Büchel

NewsArchive
05-11-2012, 02:01 AM
Dirk,

> Is it possible to integrate a clock?
>
> Second counter.
>
> To find out how long to develop in a loop or something else needs to
> finish it.

You can use the "Get System Info (Current Time)" function to retrieve the
current time. Perhaps you can use this to develop an algorithm that lets
you calculate what you want.

Or even better, use the GetTickCount Windows API:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms724408(v=vs.85).aspx

Use it before and after a specific process and you know how long the process
took.

Friedrich

NewsArchive
05-11-2012, 03:09 AM
I have uploaded a "GetTickCount" demo for you:

http://www.lindersoft.com/projects/GetTickCount.zip

Friedrich

NewsArchive
05-11-2012, 05:39 AM
nice, but not work when you put the first 2 lines at the beginning of a
scripts and the last 3 lines at the end of a scripts.

Dirk Büchel

NewsArchive
05-11-2012, 05:39 AM
> nice, but not work when you put the first 2 lines at the beginning
> of a scripts and the last 3 lines at the end of a scripts.

Why not?

Friedrich

NewsArchive
05-11-2012, 05:39 AM
> nice, but not work when you put the first 2 lines at the beginning
> of a scripts and the last 3 lines at the end of a scripts.

Here is another demo for you. The first two lines are located at the
beginning and the last three lines are located at the end of the script.

http://www.lindersoft.com/projects/GetTickCount2.zip

This quick-and-dirty example tells you how long the installer was active (in
milliseconds).

Move the first two lines after the first "Wizard Loop" and the last three
lines before the last "Wizard Loop" and you can calculate the "real"
installation time.

Friedrich