2 ms·
It's common to have a value called "total_elapsed_seconds" which comes from job logs, traces, etc and "leap seconds" wouldn't be relevant. You just want to "pr
by jasode 10y ago
It's common to have a value called "total_elapsed_seconds" which comes from job logs, traces, etc and "leap seconds" wouldn't be relevant. You just want to "pretty print" it into hhh:mm:ss and %mod is the easiest way to calc that.
I've used % for various unrelated tasks for more than 20 years. Another example... in languages that didn't have bit shifting like C/C++, I used % to convert bytes to a hex string (e.g. x%16).
- busterarm 10y agoI guess what I'm saying is... is calculating it easier than going: x = Time ( now ) ... total_elapsed_time = Time ( now ) - x print strftime ( total_elapsed_time ) I've actually used your hex example once before!