perfnow
Version:
0.1 kb window.performance.now high resolution timer polyfill with Date fallback
6 lines (5 loc) • 370 B
JavaScript
/**
* @file perfnow is a 0.1 kb window.performance.now high resolution timer polyfill with Date fallback
* @author Daniel Lamb <dlamb.open.source@gmail.com>
*/
function perfnow(e){"performance"in e||(e.performance={});var o=e.performance;e.performance.now=o.now||o.mozNow||o.msNow||o.oNow||o.webkitNow||Date.now||function(){return(new Date).getTime()}}perfnow(self);