From 0cb6a5c81271a61e930505f3315b1d67bdf22724 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Sun, 16 Jul 2023 22:46:06 +0200 Subject: Renamed all the notes files to include date --- content/notes/easy-time-took-in-bash.md | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 content/notes/easy-time-took-in-bash.md (limited to 'content/notes/easy-time-took-in-bash.md') diff --git a/content/notes/easy-time-took-in-bash.md b/content/notes/easy-time-took-in-bash.md deleted file mode 100644 index 999434a..0000000 --- a/content/notes/easy-time-took-in-bash.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: "Easy measure time took in a bash script" -url: easy-time-took-in-bash.html -date: 2023-05-28T17:53:20+02:00 -type: note -draft: false -tags: [bash] ---- - -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. - -```bash -#!/bin/bash - -# Reset the timer to zero. -SECONDS=0 - -# Do something. -sleep 5 - -# Print the time elapsed. -echo "Time taken: $SECONDS seconds" -``` -- cgit v1.2.3