Łukasz Lew
Łukasz Lew

Reputation: 50278

How to measure user time used by process on windows?

On linux we can use "time" command. Or from C++:

#include <sys/time.h>
#include <sys/resource.h>

int getrusage(int who, struct rusage *usage);

How to do a closest thing to that on windows ?

Upvotes: 2

Views: 1278

Answers (2)

lothar
lothar

Reputation: 20219

The best way to do precise time measuring is to use a platform independent library component like ACE_High_Res_Timer.

Upvotes: 1

aJ.
aJ.

Reputation: 35450

GetProcessTimes

This gives lpUserTime [out] : A pointer to a FILETIME structure that receives the amount of time that the process has executed in user mode. The time that each of the threads of the process has executed in user mode is determined, and then all of those times are summed together to obtain this value.

Upvotes: 3

Related Questions