michael@0: /* -*- Mode: C++; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "primpl.h" michael@0: #include michael@0: michael@0: static bigtime_t start; michael@0: michael@0: PRTime michael@0: _MD_now (void) michael@0: { michael@0: return (PRTime)real_time_clock_usecs(); michael@0: } michael@0: michael@0: void michael@0: _MD_interval_init (void) michael@0: { michael@0: /* grab the base interval time */ michael@0: start = real_time_clock_usecs(); michael@0: } michael@0: michael@0: PRIntervalTime michael@0: _MD_get_interval (void) michael@0: { michael@0: return( (PRIntervalTime) real_time_clock_usecs() / 10 ); michael@0: michael@0: #if 0 michael@0: /* return the number of tens of microseconds that have elapsed since michael@0: we were initialized */ michael@0: bigtime_t now = real_time_clock_usecs(); michael@0: now -= start; michael@0: now /= 10; michael@0: return (PRIntervalTime)now; michael@0: #endif michael@0: } michael@0: michael@0: PRIntervalTime michael@0: _MD_interval_per_sec (void) michael@0: { michael@0: return 100000L; michael@0: }