VirtualBox

Changeset 52822 in vbox for trunk/src/VBox/Runtime/r3/win


Ignore:
Timestamp:
Sep 23, 2014 10:25:34 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
96224
Message:

Runtime: Fix RTTimeMilliTS() on FreeBSD. Use macros for time units rather than hardcoded values.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/win/time-win.cpp

    r48935 r52822  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    7979     * This would work if it didn't flip over every 49 (or so) days.
    8080     */
    81     return (uint64_t)GetTickCount() * (uint64_t)1000000;
     81    return (uint64_t)GetTickCount() * RT_NS_1MS_64;
    8282
    8383#elif defined USE_PERFORMANCE_COUNTER
     
    9090    {
    9191        if (!QueryPerformanceFrequency(&llFreq))
    92             return (uint64_t)GetTickCount() * (uint64_t)1000000;
     92            return (uint64_t)GetTickCount() * RT_NS_1MS_64;
    9393        llFreq.QuadPart /=    1000;
    9494        uMult            = 1000000;     /* no math genius, but this seemed to help avoiding floating point. */
     
    9898    if (QueryPerformanceCounter(&ll))
    9999        return (ll.QuadPart * uMult) / llFreq.QuadPart;
    100     return (uint64_t)GetTickCount() * (uint64_t)1000000;
     100    return (uint64_t)GetTickCount() * RT_NS_1MS_64;
    101101
    102102#elif defined USE_FILE_TIME
     
    149149RTDECL(uint64_t) RTTimeSystemMilliTS(void)
    150150{
    151     return rtTimeGetSystemNanoTS() / 1000000;
     151    return rtTimeGetSystemNanoTS() / RT_NS_1MS;
    152152}
    153153
     
    196196    Tzi.Bias = 0;
    197197    if (GetTimeZoneInformation(&Tzi) != TIME_ZONE_ID_INVALID)
    198         return -(int64_t)Tzi.Bias * 60*1000*1000*1000;
     198        return -(int64_t)Tzi.Bias * 60 * RT_NS_1MS_64;
    199199    return 0;
    200200}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette