Add benchmark target to Makefile and save timings

This commit is contained in:
Patrick Niklaus
2016-04-04 23:04:22 +02:00
parent efe6faabfd
commit 54ee76bcef
6 changed files with 112 additions and 12 deletions
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
TIMINGS_FILE=/tmp/osrm.timings
NAME=$1
CMD=${@:2}
START=$(date "+%s.%N")
/bin/bash -c "$CMD"
END=$(date "+%s.%N")
TIME="$(echo "$END - $START" | bc)s"
NEW_ENTRY="$NAME\t$TIME\t$(date -Iseconds)"
echo -e "$NEW_ENTRY" >> $TIMINGS_FILE