Added nanosleep with float argument
[Tachyon.git] / test / accellerate_float
diff --git a/test/accellerate_float b/test/accellerate_float
new file mode 100755 (executable)
index 0000000..f41e818
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -m
+
+PATH=../src:$PATH
+
+START_TIME=`date +%s`
+./sleep_float >sleep.tmp &
+sleep 1
+read a b c TACHYON_NAME <sleep.tmp
+tachyon -a 20 $TACHYON_NAME
+fg
+END_TIME=`date +%s`
+duration=$(($END_TIME - $START_TIME))
+echo "Elapsed time is $duration"
+if [[ $duration -eq 6 ]] || [[ $duration -eq 5 ]]
+then
+   echo "Elapsed time within 7 seconds"
+   exit 0
+fi
+echo "Elapsed time $duration seconds is unexpected."
+exit 1