Check or performance.now existence

This commit is contained in:
Eric Bidelman
2016-06-01 08:43:07 -07:00
parent 0aa8dee6d4
commit 5283db1459

View File

@@ -14,7 +14,8 @@
// polyfill performance.now
if (!window.performance) {
// Note: old Safari has performance, but not now().
if (!(window.performance && window.performance.now)) {
var start = Date.now();
// only at millisecond precision
window.performance = {now: function(){ return Date.now() - start; }};