use monotonic clock for waitneeded