DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Need prgm to measure the real runtime usage of a program  (Read 15,153 times)

pstein

  • Participant
  • Joined in 2007
  • *
  • Posts: 32
Need prgm to measure the real runtime usage of a program
« on: December 02, 2007, 12:12 PM »
I want to measure sometimes the real runtime of a program for a certain task (which can be hours).
Think of an video encoding program or a huge source compilation or a defragmentation
of a whole partition or a duplicate search through all partitons of x GB.

All these programs run for hours. What I want to do now is to start the program in the evening
and let it run during the night.
When the actual work ends the total time which was necessary for this
task should be logged.
In order to compare different settings  or multiple programs I would like to know the time
which was needed by the prorgam.
Keep in mind that the progam is still running but with a CPU usage
of 0 or close to 0.

I would appreciate a utility function which monitor the CPU usage and the hard disc accesses.
When I ends for lets say more than 1 minutes it should be assumed that the program had finished its work.

Is it possible to include such a function in ProcessTamer?

Or does someone know a program which offers such a feature ?

Thank you
Peter

Eóin

  • O'Callaghan
  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,401
Re: Need prgm to measure the real runtime usage of a program
« Reply #1 on: December 02, 2007, 12:59 PM »
Perhaps Process Explorer would be useful to you, the CPU time figure could be an accurate measure of how much 'work' an application did.

[attach=#]
Interviewer: Is there anything you don't like?
Bjarne Stroustrup: Marketing hype as a substitute for technical argument. Thoughtless adherence to dogma. Pride in ignorance.

pstein

  • Participant
  • Joined in 2007
  • *
  • Posts: 32
Re: Need prgm to measure the real runtime usage of a program
« Reply #2 on: December 02, 2007, 01:36 PM »
No. It does NOT report how long (read: how many minutes) the program run until it fell asleep

Hooyoo

  • Participant
  • Joined in 2007
  • *
  • Posts: 1
Re: Need prgm to measure the real runtime usage of a program
« Reply #3 on: December 02, 2007, 03:04 PM »
You can use performance monitor to track your program, either running time or CPU usage, memory usage etc.
How to start performance monitor: %SystemRoot%\system32\perfmon.msc
MS windows only :)

Eóin

  • O'Callaghan
  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,401
Re: Need prgm to measure the real runtime usage of a program
« Reply #4 on: December 02, 2007, 03:34 PM »
When a process is idleing it uses pretty much no CPU time, so if an encoder runs full speed for 4 hours then sleeps for the rest of the night then CPU time reported the next morning should be about those four hours.

So unless the program does alot of unrelated stuff in the background which you don't want to measure then CPU time is the way to go.
Interviewer: Is there anything you don't like?
Bjarne Stroustrup: Marketing hype as a substitute for technical argument. Thoughtless adherence to dogma. Pride in ignorance.

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: Need prgm to measure the real runtime usage of a program
« Reply #5 on: December 03, 2007, 02:48 PM »
Microsoft has a tool called "time" or "timeit" iirc. in the Windows Resource Kit, which will do exactly what you want - it reports the "wall time" (ie, running time), as well as CPU time used, both user & kernel mode, and some I/O statistics as well. Great stuff!
- carpe noctem

pstein

  • Participant
  • Joined in 2007
  • *
  • Posts: 32
Re: Need prgm to measure the real runtime usage of a program
« Reply #6 on: December 03, 2007, 03:31 PM »
This is very interesting. I just tried it out a couple of times.

But it always ends with a message like

timeit.exe -a -i -d "D:\test\sophos antirootkit\sarcli.exe"
CreateProcess( ' D:\test\sophos antirootkit\sarcli.exe"') failed (2)

When I omit some flags the error remains.
Only if I run the command alone then it works

So could you give me some more information.
I did not found any further samples and tutorials in Google on how to use timeit.exe

Thank you
Peter

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: Need prgm to measure the real runtime usage of a program
« Reply #7 on: December 03, 2007, 03:36 PM »
hmmm, that sounds weird - perhaps it doesn't like spaces in filename? Try chdir'ing to the sophos folder and run timeit with a relative path.

Never had problems with timeit myself.. also, if it still fails for sophos, try it on something else and see if that works.

hth.
- carpe noctem

Original address: https://www.donationcoder.com/forum/index.php?topic=11119.0