Skip to content

Instantly share code, notes, and snippets.

@xnimorz

xnimorz/fmp1.js Secret

Last active November 1, 2019 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xnimorz/6b939a15050000b853e73fb33af5114f to your computer and use it in GitHub Desktop.
Save xnimorz/6b939a15050000b853e73fb33af5114f to your computer and use it in GitHub Desktop.
fmp
// Запланировали отрисовку
requestAnimationFrame(function() {
// кадр еще не отрисовался, но рендер три в этот момент доступно
var renderTreeFormed = performance.now();
// После этого raf кадр отрисовался
requestAnimationFrame(function() {
var fmp = performance.now();
// Пушим себе результаты замера, чтобы затем их отправить на сервер
window.globalVars.performance.fmp.push({
renderTreeFormed: renderTreeFormed,
fmp: fmp
})
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment