We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c0a98c4 commit 9064727Copy full SHA for 9064727
1 file changed
src/polyfills.js
@@ -154,3 +154,31 @@ if (!window.console)
154
window.console.log = window.console.assert = function(){};
155
window.console.warn = window.console.assert = function(){};
156
}
157
+
158
+/**
159
+ * performance.now
160
+ */
161
+(function(){
162
163
+ if ("performance" in window == false) {
164
+ window.performance = {};
165
+ }
166
167
+ Date.now = (Date.now || function () { // thanks IE8
168
+ return new Date().getTime();
169
+ });
170
171
+ if ("now" in window.performance == false)
172
+ {
173
+ var nowOffset = Date.now();
174
175
+ if (performance.timing && performance.timing.navigationStart){
176
+ nowOffset = performance.timing.navigationStart
177
178
179
+ window.performance.now = function now(){
180
+ return Date.now() - nowOffset;
181
182
183
184
+})();
0 commit comments