I have two time strings; eg. \"09:11\" and \"17:22\" on the same day (format is hh:mm). How do I calculate the time difference in minutes between these two?
Can the
@Dorian
If you just want to know how long a program took to run: time, man, man time!
Trivial example:
jonathan@Odin:~$ time sleep 1
real 0m1.001s
user 0m0.000s
sys 0m0.000s
OK, it doesn't give the result in seconds, but you can make it do so with a format string, or more simply with the POSIX compliance option:
jonathan@Odin:~$ time -p sleep 20
real 20.00
user 0.00
sys 0.00