aboutsummaryrefslogtreecommitdiff
path: root/public/easy-time-took-in-bash.html
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2023-10-31 08:20:22 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2023-10-31 08:20:22 +0100
commit22f5ac8fcec4dbfcc1f5033f18bc4eeca52a747d (patch)
tree6bdf6daa597c3335739fde4e661b6934f02c5b09 /public/easy-time-took-in-bash.html
parentd554a5924d63d3e8ef68a8e573d9f266ff80d95e (diff)
downloadmitjafelicijan.com-22f5ac8fcec4dbfcc1f5033f18bc4eeca52a747d.tar.gz
Made the side more retro!
Diffstat (limited to 'public/easy-time-took-in-bash.html')
-rwxr-xr-xpublic/easy-time-took-in-bash.html22
1 files changed, 12 insertions, 10 deletions
diff --git a/public/easy-time-took-in-bash.html b/public/easy-time-took-in-bash.html
index d9316b0..cb6cb70 100755
--- a/public/easy-time-took-in-bash.html
+++ b/public/easy-time-took-in-bash.html
@@ -1,9 +1,12 @@
1<!doctype html><html lang=en-us><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=generator content="JBMAFP - github.com/mitjafelicijan/jbmafp"><link href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL69vf8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv76+/8LBwQkAAAAAAAAAAAAAAAC+vb3/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL+9vf/Bv78JAAAAAAAAAAAAAAAAu7q6/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC7ubr/vr29CAAAAAAAAAAAy8nJAZ6foP8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnqGj/6GipAoAA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3/sAAAAAAAAAAAAAAAAAAN/7AAAAAAAAAAAAAAAAAAAAAAAAj/EAAI/5AACP8QAA3/sAAA==" rel=icon type=image/x-icon><title>Easy measure time took in a bash script</title><meta name=description content="In Bash, the $SECONDS variable is a special variable that automatically keepstrack of the number of seconds since the current shell or script startedexecuting."><link rel=alternate type=application/rss+xml title="Mitja Felicijan's posts" href=https://mitjafelicijan.com/index.xml><link rel=alternate type=application/rss+xml title="Mitja Felicijan's notes" href=https://mitjafelicijan.com/notes.xml><style>body{padding:2.5rem;max-width:1900px;background:#fff;font-family:sans-serif;line-height:1.35rem;font-size:16px}hr{margin-block-start:1.5rem}h1,h2,h3{line-height:initial}h1{font-size:xx-large}footer{margin-block-start:2rem}cap{text-transform:capitalize}table{max-width:100%;border-collapse:separate;border-spacing:2px;border:1px solid #000;border-left:1px solid #999;border-top:1px solid #999}blockquote{font-style:italic}table thead{background:#eee}ul.list li{padding:.2em 0}ul{line-height:1.4em}td,th{border:1px solid #000;padding:4px;border-right:1px solid #999;border-bottom:1px solid #999;text-align:left}pre{text-wrap:nowrap;overflow-x:auto;padding:0 1em;border:1px solid #dcdcdc}code{padding:0 3px;font-size:14px;border:0}pre code{line-height:1.3em}pre,code,pre *,code *{font-family:monospace}figure{margin-inline-start:0;margin-inline-end:0}figcaption{text-align:center}figcaption p{margin:.3em 0 0}img,video,audio{width:800px;max-width:100%}header{display:flex;flex-direction:row;gap:6rem}nav{display:flex;gap:.75rem}nav.main{}.pstatus-orange{background:gold}.pstatus-green{background:#9acd32}.pstatus-red{background:#cd5c5c}@media only screen and (max-width:600px){body{padding:15px}header{flex-direction:column;gap:1rem}a{word-wrap:break-word}}</style><header><nav class=main itemscope itemtype=http://schema.org/SiteNavigationElement role=toolbar><a href=/>Home</a> 1<!doctype html><html lang=en-us><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=generator content="JBMAFP - github.com/mitjafelicijan/jbmafp"><link href="data:image/x-icon;base64,AAABAAEAEBAAAAEA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xOv8XGSD/I8rg/yPK4P8XGiD/GUFL/yPP6f8SERj/Fhkh/x3A4f8AAAAAJ2f9/ydr//8mZPH/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlYu38J2v//ydo/f8AAAAAAAAAAAd8/fkFqf//Iob8sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMY39awWr//8FfP3/AAAAAAAAAAAFm/7/SfD//wR+/f8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOB/f9B7v//BaX+/wAAAAAAAAAAQ878SAyZ/v9n1v4KAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADu9v8DDJb+/z3N/XgAAAAA3/sAAN/7AADf+wAA3/sAAAAAAAAAAAAAAAAAAN/7AAAAAAAAAAAAAAAAAAAAAAAAj/EAAI/5AACP8QAA3/sAAA==" rel=icon type=image/x-icon><title>Easy measure time took in a bash script</title><meta name=description content="In Bash, the $SECONDS variable is a special variable that automatically keepstrack of the number of seconds since the current shell or script startedexecuting."><link rel=alternate type=application/rss+xml title="Mitja Felicijan's posts" href=https://mitjafelicijan.com/index.xml><link rel=alternate type=application/rss+xml title="Mitja Felicijan's notes" href=https://mitjafelicijan.com/notes.xml><style>:root{--border-color:gainsboro}body{padding:2.5rem;max-width:1900px;background:#fff;font-family:sans-serif;line-height:1.35rem;font-size:16px}hr{margin-block-start:1.5rem}a{color:blue;text-decoration:none}h1,h2,h3{line-height:initial}h1{font-size:xx-large}footer{margin-block-start:2rem}cap{text-transform:capitalize}blockquote{font-style:italic}table{max-width:100%;border:1px solid var(--border-color);border-collapse:separate;border-spacing:0}table thead tr th{border-bottom:1px solid var(--border-color)}table th,table td{padding:.3em .5em}ul.list li{padding:.2em 0}ul{line-height:1.35em}pre{text-wrap:nowrap;overflow-x:auto;padding:0 1em;border:1px solid var(--border-color)}code{padding:0 3px;font-size:14px;border:0}pre code{line-height:1.3em}pre,code,pre *,code *{font-family:monospace}figure{margin-inline-start:0;margin-inline-end:0}figcaption{text-align:center}figcaption p{margin:.3em 0 0}img,video,audio{width:800px;max-width:100%}header nav{display:flex;gap:.9rem}@media only screen and (max-width:600px){body{padding:.5em;word-wrap:break-word}header nav{gap:.7rem}header nav .hob{display:none}a{word-wrap:break-word}}</style><header><nav class=main itemscope itemtype=http://schema.org/SiteNavigationElement role=toolbar><a href=/>Home</a>
2<a href=https://github.com/mitjafelicijan target=_blank>Code</a> 2<a href=/#posts>Posts</a>
3<a href=/#notes>Notes</a>
4<a href=/#sideprojects class=hob>Side Projects</a>
3<a href=/vault.html>Vault</a> 5<a href=/vault.html>Vault</a>
4<a href=/mitjafelicijan.pgp.pub.txt target=_blank>PGP</a> 6<a href=https://github.com/mitjafelicijan target=_blank>Code</a>
7<a href=/mitjafelicijan.pgp.pub.txt target=_blank class=hob>PGP</a>
5<a href=/curriculum-vitae.html>CV</a> 8<a href=/curriculum-vitae.html>CV</a>
6<a href=/index.xml target=_blank>RSS</a></nav></header><main role=main><article itemtype=http://schema.org/Article><h1 itemtype=headline>Easy measure time took in a bash script</h1><p><cap>note</cap>, May 28, 2023 on <a href=https://mitjafelicijan.com>Mitja Felicijan's blog</a><div><p>In Bash, the <code>$SECONDS</code> variable is a special variable that automatically keeps 9<a href=/index.xml target=_blank class=hob>RSS</a></nav></header><main role=main><article itemtype=http://schema.org/Article><h1 itemtype=headline>Easy measure time took in a bash script</h1><p><cap>note</cap>, May 28, 2023 on <a href=https://mitjafelicijan.com>Mitja Felicijan's blog</a><div><p>In Bash, the <code>$SECONDS</code> variable is a special variable that automatically keeps
7track of the number of seconds since the current shell or script started 10track of the number of seconds since the current shell or script started
8executing. It starts counting from the moment the script begins running.<pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span><span style=color:#00f>#!/bin/bash 11executing. It starts counting from the moment the script begins running.<pre tabindex=0 style=background-color:#fff><code><span style=display:flex><span><span style=color:#00f>#!/bin/bash
9</span></span></span><span style=display:flex><span><span style=color:#00f></span> 12</span></span></span><span style=display:flex><span><span style=color:#00f></span>
@@ -15,7 +18,7 @@ executing. It starts counting from the moment the script begins running.<pre tab
15</span></span><span style=display:flex><span> 18</span></span><span style=display:flex><span>
16</span></span><span style=display:flex><span><span style=color:green># Print the time elapsed.</span> 19</span></span><span style=display:flex><span><span style=color:green># Print the time elapsed.</span>
17</span></span><span style=display:flex><span>echo <span style=color:#a31515>&#34;Time taken: </span>$SECONDS<span style=color:#a31515> seconds&#34;</span> 20</span></span><span style=display:flex><span>echo <span style=color:#a31515>&#34;Time taken: </span>$SECONDS<span style=color:#a31515> seconds&#34;</span>
18</span></span></code></pre></div></div></main><section><hr><h2>Posts from blogs I follow around the net</h2><ul><li><a href=https://utcc.utoronto.ca/~cks/space/blog/solaris/ZFSWhyNotDirectoryToFilesystem target=_blank rel=noopener>One reason that ZFS can't turn a directory into a filesystem</a> — <a href=https://utcc.utoronto.ca/~cks/space/blog/>Chris's Wiki :: blog</a><div>One of the wishes that I and other people frequently have for ZFS 21</span></span></code></pre></div></article></main><section><hr><h2>Posts from blogs I follow around the net</h2><ul><li><a href=https://utcc.utoronto.ca/~cks/space/blog/solaris/ZFSWhyNotDirectoryToFilesystem target=_blank rel=noopener>One reason that ZFS can't turn a directory into a filesystem</a> — <a href=https://utcc.utoronto.ca/~cks/space/blog/>Chris's Wiki :: blog</a><div>One of the wishes that I and other people frequently have for ZFS
19is the ability to take an existing directory (and everything 22is the ability to take an existing directory (and everything
20underneath it) in a ZFS filesystem and turn it into a sub-filesystem 23underneath it) in a ZFS filesystem and turn it into a sub-filesystem
21of its own. One reason for wanting this is that a number of things 24of its own. One reason for wanting this is that a number of things
@@ -47,8 +50,7 @@ In this article, I describe my goals, which hardware I picked for my new build (
47Design Goals 50Design Goals
48I use my netw…</ul><p>Generated with <a href=https://git.sr.ht/~sircmpwn/openring target=_blank rel=noopener>openring</a>.</section><footer><hr><p><big><strong>Want to comment or have something to add?</strong></big><p>You can write me an email 51I use my netw…</ul><p>Generated with <a href=https://git.sr.ht/~sircmpwn/openring target=_blank rel=noopener>openring</a>.</section><footer><hr><p><big><strong>Want to comment or have something to add?</strong></big><p>You can write me an email
49at <a href=mailto:mitja.felicijan@gmail.com>mitja.felicijan@gmail.com</a> or 52at <a href=mailto:mitja.felicijan@gmail.com>mitja.felicijan@gmail.com</a> or
50catch up with me <a href=https://telegram.me/mitjafelicijan target=_blank>on Telegram</a>.<hr><p>This website does not track you. Content is made available under 53catch up with me <a href=https://telegram.me/mitjafelicijan target=_blank>on Telegram</a>.<hr><p>This website does not track you. Content is made available under the <a href=https://creativecommons.org/licenses/by/4.0/ target=_blank rel=noreferrer>CC BY 4.0 license</a> unless
51the <a href=https://creativecommons.org/licenses/by/4.0/ target=_blank rel=noreferrer>CC BY 4.0 license</a> unless specified 54specified otherwise. Blog is also available as <a href=/index.xml target=_blank>RSS feed</a>.</footer><script>
52otherwise. Blog is also available as <a href=/index.xml target=_blank>RSS feed</a>.</footer><script> 55 window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };
53 window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); }; 56 </script><script defer src=/_vercel/insights/script.js></script> \ No newline at end of file
54 </script><script defer src=/_vercel/insights/script.js></script> \ No newline at end of file