diff --git a/lib/childprocess/abstract_process.rb b/lib/childprocess/abstract_process.rb index 93fd064..3a711f2 100644 --- a/lib/childprocess/abstract_process.rb +++ b/lib/childprocess/abstract_process.rb @@ -152,8 +152,8 @@ def crashed? def poll_for_exit(timeout) log "polling #{timeout} seconds for exit" - end_time = Time.now + timeout - until (ok = exited?) || Time.now > end_time + end_time = Process.clock_gettime(Process::CLOCK_MONOTONIC) + timeout + until (ok = exited?) || Process.clock_gettime(Process::CLOCK_MONOTONIC) > end_time sleep POLL_INTERVAL end