nsprpub/pr/src/md/beos/btime.c

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/nsprpub/pr/src/md/beos/btime.c	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,43 @@
     1.4 +/* -*- Mode: C++; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "primpl.h"
    1.10 +#include <kernel/OS.h>
    1.11 +
    1.12 +static bigtime_t start;
    1.13 +
    1.14 +PRTime
    1.15 +_MD_now (void)
    1.16 +{
    1.17 +    return (PRTime)real_time_clock_usecs();
    1.18 +}
    1.19 +
    1.20 +void
    1.21 +_MD_interval_init (void)
    1.22 +{
    1.23 +    /* grab the base interval time */
    1.24 +    start = real_time_clock_usecs();
    1.25 +}
    1.26 +
    1.27 +PRIntervalTime
    1.28 +_MD_get_interval (void)
    1.29 +{
    1.30 +    return( (PRIntervalTime) real_time_clock_usecs() / 10 );
    1.31 +
    1.32 +#if 0
    1.33 +    /* return the number of tens of microseconds that have elapsed since
    1.34 +       we were initialized */
    1.35 +    bigtime_t now = real_time_clock_usecs();
    1.36 +    now -= start;
    1.37 +    now /= 10;
    1.38 +    return (PRIntervalTime)now;
    1.39 +#endif
    1.40 +}
    1.41 +
    1.42 +PRIntervalTime
    1.43 +_MD_interval_per_sec (void)
    1.44 +{
    1.45 +    return 100000L;
    1.46 +}

mercurial