I would like to format some commands execution times in a human readable format, for example:
3 -> 3ms
1100 -> 1s 100ms
62000 -> 1m 2s
etc ..
Taking into account days, hours, minutes, seconds, ...
Is it possible using C#
?
I would like to format some commands execution times in a human readable format, for example:
3 -> 3ms
1100 -> 1s 100ms
62000 -> 1m 2s
etc ..
Taking into account days, hours, minutes, seconds, ...
Is it possible using C#
?
What about this?
For example to get
00:01:35.0090000
as 0 hours, 1 minutes, 35 seconds and 9 milliseconds you can use this:Your output:
Well i normally hate writing if statements but some times what you really have is a nail and need a hammer.
You can use TimeSpan class, something like this:
It's quite similar as this thread I've just found:
What is the best way to convert seconds into (Hour:Minutes:Seconds:Milliseconds) time?