Skip to content

Commit

Permalink
Added test script
Browse files Browse the repository at this point in the history
  • Loading branch information
yse committed Feb 18, 2016
1 parent 3dbb675 commit d12ff7f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

DISABLED_PROF=./bin/profiler_sample_disable
ENABLED_PROF=./bin/profiler_sample_enable

DISABLE_FILE=disable.info
ENABLE_FILE=enable.info

for i in {1..100}
do
$DISABLED_PROF >> $DISABLE_FILE
$ENABLED_PROF >> $ENABLE_FILE
done

DISABLE_AVERAGE_TIME=`awk '{s+=$1}END{print s/NR}' RS=" " $DISABLE_FILE`
ENABLE_AVERAGE_TIME=`awk '{s+=$1}END{print s/NR}' RS=" " $ENABLE_FILE`

DT=`echo "$ENABLE_AVERAGE_TIME - $DISABLE_AVERAGE_TIME" | bc -l`
PERCENT=`echo "$DT*100.0/$ENABLE_AVERAGE_TIME" | bc -l`
echo "dT: $DT usec"
echo "percent: $PERCENT%"

0 comments on commit d12ff7f

Please sign in to comment.