[ovs-dev] [PATCH 1/2] timeval: clock_gettime() for Windows.

Gurucharan Shetty shettyg at nicira.com
Tue Mar 4 17:10:14 UTC 2014


On Tue, Mar 4, 2014 at 8:59 AM, Ben Pfaff <blp at nicira.com> wrote:
> On Mon, Mar 03, 2014 at 02:46:27PM -0800, Gurucharan Shetty wrote:
>> QueryPerformanceCounter() retrieves the current value of the performance
>> counter, which is a high resolution (<1us) time stamp that can be used for
>> time-interval measurements. So, use it for MONOTONIC clock.
>>
>> The GetSystemTimePreciseAsFileTime() function retrieves the current system date
>> and time with the highest possible level of precision (<1us). Use it for
>> real time clock. This function returns a counter representing the number of
>> 100-nanosecond intervals since January 1, 1601. To make it compatible with
>> Linux CLOCK_REALTIME, we need to calculate the 100-nanoseconds counter value
>> till 01/01/1970.
>>
>> An upcoming commit implements gettimeofday() using the same clock, so,
>> carve out a function.
>>
>> Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
>
> Acked-by: Ben Pfaff <blp at nicira.com>
>
I suppose this was meant for patch2 and not patch1.

Thanks,
Guru
> I'd also be OK with implementing this in terms of xclock_gettime() on
> all platforms.



More information about the dev mailing list