Bugfix: accelleration is divided twice master
authorArjen Baart <arjen@andromeda.nl>
Fri, 4 Sep 2020 06:02:00 +0000 (08:02 +0200)
committerArjen Baart <arjen@andromeda.nl>
Fri, 4 Sep 2020 06:02:00 +0000 (08:02 +0200)
src/Tachyon.cpp
test/accellerate_float

index 5a32f9a..51b7f8f 100644 (file)
@@ -265,7 +265,7 @@ int Tachyon::nanosleep(float req)
 
    virt_time = gettime();
 
-   seconds     = req / accelleration;
+   seconds     = req;
    nanoseconds = (seconds - trunc(seconds)) * 1.0e9;
 
    req_t.tv_sec  = trunc(seconds);
@@ -302,7 +302,7 @@ int Tachyon::sleep_until(timespec ends_at)
       period.tv_sec  = trunc(seconds);
       period.tv_nsec = trunc(nanoseconds);
 
-      //printf("Sleeping for : %d,%d\n", period.tv_sec, period.tv_nsec);
+      //printf("Tachyon: Sleeping for : %d,%d\n", period.tv_sec, period.tv_nsec);
       errno = 0;
       sleep_return = ::nanosleep(&period, &remaining);
       //printf("nanosleep returns %d, error = %s\n", sleep_return, strerror(errno));
index 8ff7325..b04401f 100755 (executable)
@@ -15,9 +15,9 @@ duration=$(($END_TIME - $START_TIME))
 echo "Elapsed time is $duration"
 cat sleep.tmp
 
-if [[ $duration -eq 1 ]] || [[ $duration -eq 2 ]]
+if [[ $duration -eq 2 ]] || [[ $duration -eq 3 ]]
 then
-   echo "Elapsed time within 2 seconds"
+   echo "Elapsed time within 3 seconds"
    exit 0
 fi
 echo "Elapsed time $duration seconds is unexpected."