We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 973b8b6 + 69d1169 commit 9a4af70Copy full SHA for 9a4af70
collect.sh
100755
100644
@@ -1,5 +1,6 @@
1
#!/bin/bash
2
3
+NS=1000000000
4
5
rm -rf data/$1
6
mkdir data/$1
@@ -31,6 +32,7 @@ case "$1" in
31
32
33
for (( i=0;i<=$2;i++ ))
34
do
35
+ START_TIME=$(date +%s%N)
36
#echo $i" second is collected"
37
PID=$(pgrep -f $1)
38
#PYfiles=$(ls data/python3)
@@ -98,8 +100,15 @@ do
98
100
fi
99
101
102
#echo $TIME" 0 0 0 0" >> "data/ref.log"
-
- sleep 1
103
+
104
+ END_TIME=$(date +%s%N)
105
+ ELAPSED=$(($END_TIME - $START_TIME))
106
+ SLEEP_TIME=$(($NS - $ELAPSED))
107
108
+ if (( SLEEP_TIME > 0 )); then
109
+ SLEEP_SECONDS=$(awk "BEGIN {printf \"%.9f\", $SLEEP_TIME/$NS}")
110
+ sleep $SLEEP_SECONDS
111
+ fi
112
done
113
114
echo "Collection for "$1" done"
0 commit comments