Hi,
If I want to calculate the elapsed-time of some operations, like sorting a array, which header should i use and which function should i use?
probably the first answer will help me to find the second answer myself. Please advise.
joey
Printable View
Hi,
If I want to calculate the elapsed-time of some operations, like sorting a array, which header should i use and which function should i use?
probably the first answer will help me to find the second answer myself. Please advise.
joey
What operating system and compiler?
i use Visual C++ on Windows
look into QueryPerformanceCounter()
In C++, to calculate the elapsed time, we can use
CTime startTime = CTime::GetCurrentTime();
// ... perform time-consuming task ...
CTime endTime = CTime::GetCurrentTime();
CTimeSpan elapsedTime = endTime - startTime;
What is the method in C?