/* * For a given microsecond delay, return the target time in LowResTime. */ LowResTime getDelayTarget (HsInt us) { Time elapsed; elapsed = getProcessElapsedTime(); // If the desired target would be larger than the maximum Time, // default to the maximum Time. (#7087) if (us > TimeToUS(TIME_MAX - elapsed)) { return TimeToLowResTimeRoundDown(TIME_MAX); } else { // round up the target time, because we never want to sleep *less* // than the desired amount. return TimeToLowResTimeRoundUp(elapsed + USToTime(us)); } }
/* * For a given microsecond delay, return the target time in LowResTime. */ LowResTime getDelayTarget (HsInt us) { // round up the target time, because we never want to sleep *less* // than the desired amount. return TimeToLowResTimeRoundUp(getProcessElapsedTime() + USToTime(us)); }