I honestly don't have any idea in accessing or timing the running program in my OS..that's why I'm having a hard time in writing a program that calculate the startup process of another program that I'm about to run after i run my cpp program..please help.
example:
first I run the cpp program which I am needing your help in coding
then, I run a certain program like paint.exe
then, my cpp program used then calculate the time used in starting up paint.exe it is either in seconds or in milliseconds.
so far i have this..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <iostream>
#include <time.h>
usingnamespace std;
int main()
{
clock_t start, end;
double diff;
start = clock();
//here I think i will put the code that access the OS
end = clock();
diff = (double(start-end)/CLOCKS_PER_SEC);
cout << diff;
return 0;
}
btw, I'm running my program in Linux..
thank you in advance!