Easy measure time took in a bash script

note, May 28, 2023, on Mitja Felicijan's blog

In Bash, the $SECONDS variable is a special variable that automatically keeps track of the number of seconds since the current shell or script started executing. It starts counting from the moment the script begins running.

#!/bin/bash

# Reset the timer to zero.
SECONDS=0

# Do something.
sleep 5

# Print the time elapsed.
echo "Time taken: $SECONDS seconds"

Other notes

DateTitle
Currated list of Vim ALE linters
Extending dte editor
Make DCSS playable on 4k displaysdcss
Male and female body proportion reference images3d
AWS EB PyYAML fix
Previews how man page written in Troff will look like
Aerial photography of algae spotted on river Sava
Execute not blocking async shell command in C#
My brand new Plan9/9front desktopplan9
Use option key as meta in Alacritty under macOS
Change Alt key to Win key under Xfce4
Fix screen tearing on Debian 12 Xorg and i3
Make B/W SVG charts with matplotlib
Simple presentations with Markdown
Alacritty open links with modifier