mirror of
https://github.com/jlengrand/webcomponentsjs.git
synced 2026-03-10 08:51:22 +00:00
Check or performance.now existence
This commit is contained in:
@@ -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; }};
|
||||
|
||||
Reference in New Issue
Block a user