#!/bin/bash# get user inputZENITY1=$(zenity --entry --text '  1m:    60s\n  5m:   300s\n10m:   600s\n15m:   900s\n20m: 1200s\n25m: 1500s\n30m: 1800s\n35m: 2100s\n40m: 2400s\n45m: 2700s\n50m: 3000s\n55m: 3300s\n   1h: 3600s' --entry-text Input only int in seconds! --title Timer)# put starting date in variableSTARTTIME=$(date)# audit/check user inputWAITINGTIME=$(echo $ZENITY1 | egrep [0-9]{1,} -o)if [ $WAITINGTIME ==  ]; then exit 1; fi# main stopwatchfor i in `seq $WAITINGTIME -1 1`; do echo $i | osd_cat -A left -p top -i 100 -c black -d 1; done# time expired messagezenity --info --text=Time expired@\n$(date)\n\nStarted@\n$STARTTIMESo this is the script that I have on my desktop. If I need to warn somebody for e.x.: please warn me after 15 minutes. But if I use it in a longer time, e.x.: 12 hours it's not very accurate! it could get ~10 minutes difference to the real time... :\ Why is it?
Timer in bash script not accurate when using it with longer times
bash;shell script
If you find it takes consistently too long, I guess you're seeing the overhead of fourty-odd thousand executions of echo and osd_cat.