Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recording the time of processes....??

Status
Not open for further replies.

victorjs

Programmer
Dec 22, 2004
3
MT
Ermm...Is there a way to track process times? How can one record the time of how long a process lasts? Processes take just milliseconds, so one should be aware to make wise use of time scales including milliseconds!
Should one make use of GetLocalTime(), or what?
 
There are quite a few ways to do it, but this is how I do it :

Code:
#include <time.h>
#include <stdio.h>

int main() {
	int start, end;
	start = clock();

	end = clock();

	printf("Complete : %d millis \n", (int)((end-start)*1E3/CLOCKS_PER_SEC));

	return 0;
}

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top