I know there might be benchmarking libraries out there that do this, but I'd like to figure out how to do it myself (if only for the sake of knowing how to do it). The idea is to make sure that first and second have minimal differences, ideally identical.įrom what I see, the high_resolution_clock class (and all the other chrono clocks), keep their time_point private, and you can only access it from clock.now() Std::chrono::time_point paused_tp = clock.now() ĬtTime(paused_tp) // Something like this is what I want (and I think it'd be a good feature regardless, if I have other things I want to skip) std::chrono::high_resolution_clock clock I want the clock to "skip over" this process in a sense, since the stuff I'm measuring would be in the microseconds. The thing is that in the process of getting the time interval, converting it into a number, getting time format, and then converting everything into a string, and then print it out takes a while (2-3 milliseconds), I/O especially seems expensive. The way I have it now supports nesting of these measurements. I wrote something to measure how long my code takes to run, and to print it out.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |