Code: Select all
#!/bin/bash start=`date +%s` #some script end=`date +%s` runtime=$((end-start)) echo $runtime
I do not echo statement. I want time to leave the string as runtime.runtime=/usr/bin/printf "%.0f\n" $(echo "scale = 1; $runtime / 1000000" | bc)
curl -F "data="$runtime http://www.example.com/send_time.php
Are you running all the code or just that one line? You'll notice it refers to the same variable that it sets, so it would be good to have it set before calling it. Or you'll get zero.napajedlaci.cz wrote:Unfortunately, only I get zero.