• Austin Clements's avatar
    runtime: use next timer to decide whether to relax · 093adeef
    Austin Clements authored
    Currently, sysmon waits 60 ms during idle before relaxing. This is
    primarily to avoid reducing the precision of short-duration timers. Of
    course, if there are no short-duration timers, this wastes 60 ms
    running the timer at high resolution.
    
    Improve this by instead inspecting the time until the next timer fires
    and relaxing the timer resolution immediately if the next timer won't
    fire for a while.
    
    Updates #20937.
    
    Change-Id: If4ad0a565b65a9b3e8c4cdc2eff1486968c79f24
    Reviewed-on: https://go-review.googlesource.com/47833
    Run-TryBot: Austin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    093adeef
time.go 6.44 KB