googletest icon indicating copy to clipboard operation
googletest copied to clipboard

Feature request - Option to record elapsed time as cpu (user+kernel) time

Open jvdevel opened this issue 7 years ago • 1 comments

Currently, times in googletest are always based on "wall clock" system time, so test's elapsed time is computed as differences of this "absolute" system time.

This is typically ok, but in some cases it could be desirable to compute the actual cpu time spent. This is important when comparing consecutive runs of the test executions in order to analyze the trend of the elapsed time.

I propose to add a command line switch to select the kind of time recorded in the test elapsed time, so we can keep the current behavior by default. Of course, this feature may not be available in all systems, but at least in major modern OSes for sure this can be implemented.

jvdevel avatar Jun 08 '19 09:06 jvdevel

Thanks for this request and apologies for the delay in response. While I agree that this would be useful, I am closing this issue as it is outside the scope of what GoogleTest is trying to support. If timings are of interest, consider using https://github.com/google/benchmark. Even with CPU time, GoogleTest is unlikely to yield reliable numbers.

asoffer avatar Jan 07 '20 02:01 asoffer