From 1100562e29f6476448b656dbddd4cf22505523f6 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Sun, 10 Mar 2024 14:59:14 +0100 Subject: Move back to JBMAFP --- _posts/notes/2023-05-28-easy-time-took-in-bash.md | 26 ----------------------- 1 file changed, 26 deletions(-) delete mode 100644 _posts/notes/2023-05-28-easy-time-took-in-bash.md (limited to '_posts/notes/2023-05-28-easy-time-took-in-bash.md') diff --git a/_posts/notes/2023-05-28-easy-time-took-in-bash.md b/_posts/notes/2023-05-28-easy-time-took-in-bash.md deleted file mode 100644 index 958da72..0000000 --- a/_posts/notes/2023-05-28-easy-time-took-in-bash.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: "Easy measure time took in a bash script" -permalink: /easy-time-took-in-bash.html -date: 2023-05-28T17:53:20+02:00 -layout: post -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