From 0c5639f4f3ef96d8837bfb4682e945274d842a2c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 24 Nov 2021 15:52:45 +0100 Subject: More precise startup benchmark --- .github/workflows/benchmark.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to '.github/workflows/benchmark.yml') diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 171b76ebf..86f675432 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -90,15 +90,15 @@ jobs: run: | npm run clean:server:test - startCold=`date +%s` + startCold=`date +%s%3N` NODE_APP_INSTANCE=1 NODE_ENV=test node dist/server --benchmark-startup - endCold=`date +%s` - coldStartupTime=$((endCold-startCold)) + endCold=`date +%s%3N` + coldStartupTime=$(echo "scale=2; ($endCold-$startCold)/1000" | bc) - startHot=`date +%s` + startHot=`date +%s%3N` NODE_APP_INSTANCE=1 NODE_ENV=test node dist/server --benchmark-startup - endHot=`date +%s` - hotStartupTime=$((endHot-startHot)) + endHot=`date +%s%3N` + hotStartupTime=$(echo "scale=2; ($endHot-$startHot)/1000" | bc) echo '{"coldStartupTime":'$coldStartupTime',"hotStartupTime":'$hotStartupTime'}'> startup-time.json -- cgit v1.2.3