diff options
author | HansHoogerwerf <hans3132@live.nl> | 2022-10-17 17:24:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-17 17:24:59 +0300 |
commit | ff26dca83a0f788ac7853b73e9d42cec49846aa7 (patch) | |
tree | 9bab120969f8e3c2394e66ae6543376d51c2e31f /include | |
parent | 98ac5a562ad6f347bcde307d56466b2668251908 (diff) |
Fix simple mistake
Diffstat (limited to 'include')
-rw-r--r-- | include/functions | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/include/functions b/include/functions index db4c7ef8..5ae9b978 100644 --- a/include/functions +++ b/include/functions @@ -2562,17 +2562,19 @@ GetTimestamp() { ts=0 - # Detect if the implementation of date supports nanoseconds, - if [ "${OS}" = "Linux" ]; then - current_nanoseconds=$(date "+%N") - # Verify if the result of the command is a number + # Detect if the implementation of date supports nanoseconds, + if [ "${OS}" = "Linux" ]; then + current_nanoseconds=$(date "+%N") + # Verify if the result of the command is a number if [ -n "$current_nanoseconds" ] && [ "$current_nanoseconds" -eq "$current_nanoseconds" ] 2>/dev/null; then ts=$(date "+%s%N") else - ts=$(date "+%s") - fi + ts=$(date "+%s") + fi + else + ts=$(date "+%s") fi - echo $ts + echo $ts } Register() { |