• Show log

    Commit

  • Hash : ddd69d39
    Author : Nick Mathewson
    Date : 2012-04-17T13:04:02

    EVENT_BASE_FLAG_PRECISE_TIMER indicates we want fine timer precision
    
    There are a bunch of backends that can give us a reasonably good
    monotonic timer quickly, or a very precise monotonic timer less
    quickly.  For example, Linux has CLOCK_MONOTONIC_COARSE (1msec
    precision), which is over twice as fast as CLOCK_MONOTONIC.  Since
    epoll only lets you wait with 1msec precision,
    CLOCK_MONOTONIC_COARSE is a clear win.
    
    On Windows, you've got GetTickCount{,64}() which is fast, and
    QueryPerformanceCounter, which is precise but slow.
    
    Note that even in the cases where the underlying timer claims to
    have nanosecond resolution, we're still not exposing that via
    Libevent.
    
    Note also that "Precision" isn't the same as "Resolution" or
    "Accuracy".  A timer's precision is the smallest change that the
    clock will register; a timer's resolution is the fineness of its
    underlying representation; a timer's accuracy is how much it drifts
    with respect to "Real Time", whatever that means.  (Terms and
    definitions from PEP 418.)