UNPKG

1.43 kBTypeScriptView Raw
1/**
2 * Returns a timestamp in seconds since the UNIX epoch using the Date API.
3 */
4export declare const dateTimestampInSeconds: () => number;
5/**
6 * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the
7 * availability of the Performance API.
8 *
9 * See `usingPerformanceAPI` to test whether the Performance API is used.
10 *
11 * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is
12 * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The
13 * skew can grow to arbitrary amounts like days, weeks or months.
14 * See https://github.com/getsentry/sentry-javascript/issues/2590.
15 */
16export declare const timestampInSeconds: () => number;
17export declare const timestampWithMs: () => number;
18/**
19 * A boolean that is true when timestampInSeconds uses the Performance API to produce monotonic timestamps.
20 */
21export declare const usingPerformanceAPI: boolean;
22/**
23 * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.
24 */
25export declare let _browserPerformanceTimeOriginMode: string;
26/**
27 * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the
28 * performance API is available.
29 */
30export declare const browserPerformanceTimeOrigin: number | undefined;
31//# sourceMappingURL=time.d.ts.map
\No newline at end of file