Using StartTimer and StopTimer functions defined in time.cpp, we can measure the elapsed time for computation.
- Define an index and an output message by using StampTime function in time.cpp. For example, the index and the output message for the elapsed time of TPQ calculation is defined as follows.
- Include CalcTime.h in the target source file.
- Set StartTimer and StopTimer functions in the region where you want to measure the time. It is noted that both functions must have the same index defined in time.cpp. For example, the elapsed time of TPQ calculation can be measured as follows.
case TPQCalc:
return 0;
}
break;
When above procedures were done, after calculation, you can see the elapsed time in CalcTimer.dat file as follows. The time unit is second.