]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/jaegertracing/opentelemetry-cpp/third_party/prometheus-cpp/3rdparty/civetweb/src/third_party/duktape-1.5.2/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.5.2 / polyfills / performance-now.js
diff --git a/ceph/src/jaegertracing/opentelemetry-cpp/third_party/prometheus-cpp/3rdparty/civetweb/src/third_party/duktape-1.5.2/polyfills/performance-now.js b/ceph/src/jaegertracing/opentelemetry-cpp/third_party/prometheus-cpp/3rdparty/civetweb/src/third_party/duktape-1.5.2/polyfills/performance-now.js
new file mode 100644 (file)
index 0000000..dfb0a1d
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ *  Performance.now() polyfill
+ *
+ *  http://www.w3.org/TR/hr-time/#sec-high-resolution-time
+ *
+ *  Dummy implementation which uses the Date built-in and has no higher
+ *  resolution.  If/when Duktape has a built-in high resolution timer
+ *  interface, reimplement this.
+ */
+
+var _perfNowZeroTime = Date.now();
+
+if (typeof Performance === 'undefined') {
+    Object.defineProperty(this, 'Performance', {
+        value: {},
+        writable: true, enumerable: false, configurable: true
+    });
+}
+if (typeof Performance.now === 'undefined') {
+    Object.defineProperty(Performance, 'now', {
+        value: function () {
+            return Date.now() - _perfNowZeroTime;
+        }, writable: true, enumerable: false, configurable: true
+    });
+}