JSFiddle - React, Tailwind, and code Playground
by David Storey
HTML
<p id="support">Is performance.now supported?</p>
CSS
.supported {
background-color: lime;
}
.unsupported {
background-color: red;
}
.prefixed {
background-color: orange;
}
}
JavaScript
var el = document.getElementById("support");
if (window.performance && typeof window.performance.now !== "undefined") {
el.textContent = "performance.now is supported!";
el.className = "supported";
} else if (window.performance && typeof window.performance.webkitNow !== "undefined") {
el.textContent = "performance.webkitNow is supported!";
el.className = "prefixed";
} else {
el.textContent = "performance.now is not supported :(";
el.className = "unsupported";
}