You are not logged in.
Hi there,
a (hopefully) simple question for the bash gods out there :)
Lets say i have a script looking like this:
#!/bin/bash
some_function() {
doing something
}
some_function
How can i measure the time (preferably in human-readable form: minutes or even hours) the bash function takes for a run?
I know about "time", but i want to do it directly inside the script...
Google tells me nothing, apart from one site where i have to pay for a solution :/
Thanks for any suggestions
Jan
Last edited by funkyou (2008-09-01 13:21:04)
want a modular and tweaked KDE for arch? try kdemod
Offline
iphitus@laptop:~$ sh test.sh
Hi
Bye
real 0m10.002s
user 0m0.000s
sys 0m0.003s
iphitus@laptop:~$ cat test.sh
somefunc(){
echo "Hi"
sleep 10
echo "Bye"
}
time somefunc
Time appears to work within bash scripts too
Offline
So simple i didnt even consider trying it, thanks!
want a modular and tweaked KDE for arch? try kdemod
Offline