Actions
Feature #3938
closedWould like %N support in date(1)
Start date:
2013-07-28
Due date:
% Done:
0%
Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:
Description
From the Joyent bug report:
In Linux date(1) supports %N which outputs the nanoseconds of the current time:
joshw@bh1-www0:~$ date +%s.%N 1347312240.211019753 joshw@bh1-www0:~$ date +%s.%N 1347312241.420862398 joshw@bh1-www0:~$ date +%s.%N 1347312242.260851519 joshw@bh1-www0:~$ date +%s.%N 1347312242.990919297 joshw@bh1-www0:~$ date +%s.%N 1347312243.660914691 joshw@bh1-www0:~$ date +%s.%N 1347312244.300927523 joshw@bh1-www0:~$
which allows for nanosecond. In my use-case I just need something smaller than 1 second (ms would be great) that's available from bash. I have a shell script that does many things in one second and I just want to keep track internally of the time that each one of the steps takes. The steps themselves involve more than one command so using time(1) doesn't work so well for me.
Related issues
Updated by Keith Wesolowski over 10 years ago
- Status changed from New to Closed
- % Done changed from 90 to 0
- Difficulty changed from Medium to Bite-size
Actions