


The script can either be used as a stop watch (counting up until interrupted) or as a timer that runs for the specified amount of time. The tool that I have in my $PATH looks like this: #!/bin/sh The latter is inadequate because it keeps the CPU busy for no good reason. After enough time passed, the counter will skip a second. The former is inadequate because due to the small time spent doing the printing, the output will not actually happen once per second but a bit less than that which is suboptimal. Instead, the proposed solutions either use a sleep 1 between subsequent timer outputs or a busy loop that outputs as fast as possible.

I'm surprised that nobody used the sleepenh tool in their scripts. In bash, add these lines to your ~/.bashrc (the sleep 0.1 will make the system wait for 1/10th of a second between each run so you don't spam your CPU): countdown() ))Ĭombine this with some way of playing sound in linux terminal ( Play MP3 or WAV file via the Linux command line) or Cygwin ( cat /path/foo.wav > /dev/dsp works for me in Babun/Windows 7) and you have a simple flexible timer with alarm! You can combine these into simple commands by using bash (or whichever shell you prefer) functions. If you need greater precision, you can use this to give you nanoseconds: while true do printf '%s\r' "$(date +%H:%M:%S:%N)" doneįinally, if you really, really want "stopwatch format", where everything starts at 0 and starts growing, you could do something like this: start=$(date +%s)įor a countdown timer (which is not what your original question asked for) you could do this (change seconds accordingly): seconds=20 That will show you the seconds passing in realtime and you can stop it with Ctrl+ C. If all you want is a stopwatch, you can do this: while true do printf '%s\r' "$(date)" done
#COUNTDOWN TIMERS FOR MAC UPDATE#
macOS 13 is currently in developer beta with a public beta coming in July – the new Mac operating system update will be released to everyone later this fall.I'm not sure why you need beep. The new Weather app on Mac and iPad is also pretty good. Multiple timer support is still limited to HomePod and Apple Watch.īringing the Clock app to the Mac might seem trivial at first, but having timers at all will likely be a welcome feature for macOS Ventura users. Unfortunately, the Clock app on the Mac suffers the same limitation as the iPhone and iPad version around timers you can only set a single timer for now. Siri on macOS Ventura can set alarms and start timers for the first time - arguably the first great feature for Siri on the Mac! The other big utility with Clock being on the Mac is gaining new Siri commands. The timer or alarm sound ring out, although it can be difficult to hear over playing music in the first beta. What happens when a timer or alarm goes off? The Clock app pushes a notification that persists until you dismiss it. I can see this new built-in feature being very useful for managing tasks and time while working on the Mac. Clicking it opens the Clock app, and the countdown continues even if you quit the Clock app. If you set a timer, the countdown is automatically added to the Menu Bar at the top of your Mac.

Where the Clock app surprises and delights is around timers. No major surprises to discover, and the Mac-adapted interface gets a passing grade. There’s even a new Mac widget for upcoming alarms. You can view time zones, set alarms, start a stopwatch, or run a timer on the Mac now - just like on iPhone and iPad. The world clock scales best to Mac-sized displays, especially if you have multiple cities added, while the other sections adjust decently. The Clock app design is very similar to the iPad version and its more compact iPhone version – a single window gives you four tab options for world clock, alarm, stopwatch, and timer. A seconds hand would be a nice touch for future macOS 13 beta versions before Ventura ships in the fall. The app icon in Finder does include a seconds hand, but it’s not a live clock. It shows the current time when placed on the Dock or in Launchpad, but there’s no seconds hand. The Clock app icon is like the analog clock that we know from iPhone and iPad. Proper Mac integration and Siri control leave only one feature to be desired… The Mac is gaining Apple’s Clock app in macOS Ventura, and it’s a surprisingly useful addition.
