]> git.proxmox.com Git - ceph.git/blame - ceph/src/jaegertracing/opentelemetry-cpp/third_party/prometheus-cpp/3rdparty/civetweb/src/third_party/duktape-1.8.0/polyfills/performance-now.js
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / third_party / prometheus-cpp / 3rdparty / civetweb / src / third_party / duktape-1.8.0 / polyfills / performance-now.js
CommitLineData
1e59de90
TL
1/*
2 * Performance.now() polyfill
3 *
4 * http://www.w3.org/TR/hr-time/#sec-high-resolution-time
5 *
6 * Dummy implementation which uses the Date built-in and has no higher
7 * resolution. If/when Duktape has a built-in high resolution timer
8 * interface, reimplement this.
9 */
10
11var _perfNowZeroTime = Date.now();
12
13if (typeof Performance === 'undefined') {
14 Object.defineProperty(this, 'Performance', {
15 value: {},
16 writable: true, enumerable: false, configurable: true
17 });
18}
19if (typeof Performance.now === 'undefined') {
20 Object.defineProperty(Performance, 'now', {
21 value: function () {
22 return Date.now() - _perfNowZeroTime;
23 }, writable: true, enumerable: false, configurable: true
24 });
25}