VirtualBox

Ignore:
Timestamp:
Sep 23, 2014 10:25:34 AM (10 years ago)
Author:
vboxsync
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/linux/time-linux.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
     
    119119        struct timespec ts;
    120120        if (!mono_clock(&ts))
    121             return (uint64_t)ts.tv_sec * (uint64_t)(1000 * 1000 * 1000)
     121            return (uint64_t)ts.tv_sec * RT_NS_1SEC_64
    122122                 + ts.tv_nsec;
    123123        fMonoClock = false;
     
    127127    struct timeval tv;
    128128    gettimeofday(&tv, NULL);
    129     return (uint64_t)tv.tv_sec  * (uint64_t)(1000 * 1000 * 1000)
    130          + (uint64_t)(tv.tv_usec * 1000);
     129    return (uint64_t)tv.tv_sec  * RT_NS_1SEC_64
     130         + (uint64_t)(tv.tv_usec * RT_NS_1US);
    131131}
    132132
     
    156156RTDECL(uint64_t) RTTimeSystemMilliTS(void)
    157157{
    158     return rtTimeGetSystemNanoTS() / 1000000;
     158    return rtTimeGetSystemNanoTS() / RT_NS_1MS;
    159159}
    160160
Note: See TracChangeset for help on using the changeset viewer.

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