#Bash + GNU utils, 43
Bash + GNU utils, 43
- Saved 2 bytes thanks to @Dennis
- Saved 5 bytes thanks to @zeppelin
c=date\ +%s%3N
s=`$c`
seq -1e3 1e3
$c-$s|bc
The date
command gives the number of seconds since the epoch concatenated with current nanoseconds. This command is run before and after. bc
takes the difference and prints.
I was hoping to do this for 17:
time seq -1e3 1e3
But the output of time gives more than we need:
real 0m0.004s
user 0m0.000s
sys 0m0.004s