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
Use option key as meta in Alacritty under macOS
Install Plan9port on Linuxplan9
Alacritty open links with modifier
AWS EB PyYAML fix
Parse RSS feeds with Lua
Take a screenshot in Plan9plan9
Make B/W SVG charts with matplotlib
Embedding resources into binary with Cc
Sane default for Dungeon Crawl Stone Soup Online editiondcss
Male and female body proportion reference images3d
Sending signals to C programsc
Download list of YouTube files
Run 9front in Qemuplan9
#cat-v on weechat configuration
Fix bootloader not being written in Plan9plan9