Skip to content

Commit

Permalink
Add check if date is accurate to microseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkopp committed Oct 22, 2024
1 parent e7c107a commit 0245e08
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ function start_measurement {
fi
mkdir -p "/tmp/eco-ci"

# check if date returns a timestamp accurate to microseconds (16 digits)
# if not probably coreutils are missing (that's the case with alpine)
microseconds=$(date "+%s%6N")
if (( ${#microseconds} < 16 )); then
echo "ERROR: Date has returned a timestamp that is not accurate to microseconds! You may need to install coreutils."
exit 1
fi

# start global timer
date "+%s%6N" > /tmp/eco-ci/timer-total.txt
cat /tmp/eco-ci/timer-total.txt
Expand Down

0 comments on commit 0245e08

Please sign in to comment.