I need to measure time for certain code block execution for research and a framework.
I have tried clock() and time() from time.h, both returns 0. I have no idea why the distance of clocks either becomes zero. But, QueryPerformanceCounter from windows.h library returns a reliable answer but not works in Linux. They'd used Large_Integer data type. What would be a lightweight way to measure time in frameworks for evaluations? It means I am looking for a gain of execution time so hate overheads.
Thanks in advance
Asked
Active
Viewed 44 times
0

Jeyakeethan Geethan
- 79
- 2
- 7
-
2https://en.cppreference.com/w/cpp/chrono/high_resolution_clock – UnholySheep Aug 22 '20 at 18:38
-
3Does this answer your question? [Measuring execution time of a function in C++](https://stackoverflow.com/questions/22387586/measuring-execution-time-of-a-function-in-c) – UnholySheep Aug 22 '20 at 18:40
-
1How can we possibly comment on what you are doing right or wrong when you don't show us your code? – Jesper Juhl Aug 22 '20 at 18:53