/*! * Copyright (c) 2020 Ville de Montreal. All rights reserved. * Licensed under the MIT license. * See LICENSE file in the project root for full license information. */ /** * A watch that can measure elapsed time using high-resolution real time */ export declare class Stopwatch { private hrstart?; private hrend?; /** * creates a new watch and start it */ static startNew(): Stopwatch; /** tells if the watch is started */ isStarted(): boolean; /** tells if the watch is stopped */ isStopped(): boolean; /** * Starts the watch. * @throws Error if the watch is already started */ start(): void; /** * Stops the watch. * @throws Error if the watch has not been started */ stop(): void; /** resets the watch */ reset(): void; /** resets the watch and start it again */ restart(): void; /** * gets the elapsed time in nano seconds since the start * @throws Error if the watch has not been started */ elapsedTimeInNanos(): bigint; /** * gets the elapsed time in milli seconds since the start * @throws Error if the watch has not been started */ elapsedTimeInMS(): number; /** gets a string representation of the watch's state */ toString(): string; }