UNPKG

1.44 kBTypeScriptView Raw
1import * as api from '@opentelemetry/api';
2/**
3 * Returns an hrtime calculated via performance component.
4 * @param performanceNow
5 */
6export declare function hrTime(performanceNow?: number): api.HrTime;
7/**
8 *
9 * Converts a TimeInput to an HrTime, defaults to _hrtime().
10 * @param time
11 */
12export declare function timeInputToHrTime(time: api.TimeInput): api.HrTime;
13/**
14 * Returns a duration of two hrTime.
15 * @param startTime
16 * @param endTime
17 */
18export declare function hrTimeDuration(startTime: api.HrTime, endTime: api.HrTime): api.HrTime;
19/**
20 * Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z"
21 * @param time
22 */
23export declare function hrTimeToTimeStamp(time: api.HrTime): string;
24/**
25 * Convert hrTime to nanoseconds.
26 * @param time
27 */
28export declare function hrTimeToNanoseconds(time: api.HrTime): number;
29/**
30 * Convert hrTime to milliseconds.
31 * @param time
32 */
33export declare function hrTimeToMilliseconds(time: api.HrTime): number;
34/**
35 * Convert hrTime to microseconds.
36 * @param time
37 */
38export declare function hrTimeToMicroseconds(time: api.HrTime): number;
39/**
40 * check if time is HrTime
41 * @param value
42 */
43export declare function isTimeInputHrTime(value: unknown): value is api.HrTime;
44/**
45 * check if input value is a correct types.TimeInput
46 * @param value
47 */
48export declare function isTimeInput(value: unknown): value is api.HrTime | number | Date;
49//# sourceMappingURL=time.d.ts.map
\No newline at end of file