11 ms·
> I really wanted to know: > “How much work did the CPU have to do in order to complete this task?” > But what time(1) tells me is: > “How long did the
by secondcoming 5y ago
> I really wanted to know:
> “How much work did the CPU have to do in order to complete this task?”
> But what time(1) tells me is:
> “How long did the CPU work to complete this task?”
Yes, exactly. It's essentially impossible to accurately time things, especially on a laptop. To answer the second question, the best bet is to use rdtscp() when micro-benchmarking, but even that has pitfalls.