Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Jul 2011 11:06:51 +0100
From:      Steven Ayre <steveayre@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   kqueue + EVFILT_TIMER unreliable timing problems
Message-ID:  <CAFiqYu=MUo0LJn11Mrf9bueWwrmmzJL3wnndYw%2B5j6m3AWHDmw@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi everyone,

I'm trying to use kqueue with EVFILT_TIMER to create an interval timer.
However, I'm getting very unreliable results.

The code for a test case is at: http://pastebin.com/ratK0AXL

I'm finding that regardless of the number of ticks I wait for, it takes
around 50% longer than it should.

For a 20ms interval, 200 ticks takes 6s not 4s, 2000 takes 60s not 40s.

I am running FreeBSD within a virtualbox VM (Windows host, no load) so I
know timing may not be as reliable as if I was on the bare metal, but this
still much higher than expected.

-Steve



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFiqYu=MUo0LJn11Mrf9bueWwrmmzJL3wnndYw%2B5j6m3AWHDmw>