]>
git.proxmox.com Git - ceph.git/blob - ceph/src/civetweb/src/third_party/duktape-1.5.2/polyfills/performance-now.js
2 * Performance.now() polyfill
4 * http://www.w3.org/TR/hr-time/#sec-high-resolution-time
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.
11 var _perfNowZeroTime
= Date
.now();
13 if (typeof Performance
=== 'undefined') {
14 Object
.defineProperty(this, 'Performance', {
16 writable
: true, enumerable
: false, configurable
: true
19 if (typeof Performance
.now
=== 'undefined') {
20 Object
.defineProperty(Performance
, 'now', {
22 return Date
.now() - _perfNowZeroTime
;
23 }, writable
: true, enumerable
: false, configurable
: true