Skip to content
  • Niklas Hambüchen's avatar
    base: fdReady(): Improve accuracy and simplify code. · 28a115e5
    Niklas Hambüchen authored and Ben Gamari's avatar Ben Gamari committed
    This is done by reusing the existing cross-platform
    `getProcessElapsedTime()` function, which already provides nanosecond
    monotonic clocks, and fallback for platforms that don't have those.
    
    To do this, `getProcessElapsedTime()` had to be moved from a private RTS
    symbol into the public interface.
    
    Accuracy is improved in 2 ways:
    
    * Use of the monotonic clock where available
    * Measuring the total time spent waiting instead of a sum
      of intervals (between which there are small gaps)
    
    Reviewers: bgamari, austin, hvr, erikd, simonmar
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3953
    28a115e5