UNPKG

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