timing.js

Navigation Timing API measurement helpers

  • 所有者: addyosmani/timing.js
  • 平台:
  • 許可證: Other
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

timing.js

Timing.js is a small set of helpers for working with the Navigation Timing API to identify where your application is spending its time. Useful as a standalone script, DevTools Snippet or bookmarklet.

Features

  • Normalizes firstPaint across Chrome, Opera and IE11 to timing.getTimes().firstPaint. Firefox may be able to do similar with MozAfterPaint
  • Adds firstPaintTime (firstPaint - load/nav start)
  • Adds:domReadyTime, initDomTreeTime, loadEventTime, loadTime, redirectTime, requestTime, unloadEventTime connectTime

Installation

Clone

Download the latest version or just git clone https://github.com/addyosmani/timing.js.git.

Bower:

$ bower install timing-js

npm:

$ npm install timing.js

Usage

By default, running the script will print out a summary table of measurements. The API for the script is as follows:

Get measurements:

timing.getTimes();

Print a summary table of measurements (uses console.table()):

timing.printSimpleTable();

Also works in Firefox DevTools (Firefox Nightly only for now):

Print a complete table of measurements (including rest of window.performance):

timing.printTable();

Sample output of timing.getTimes()

Chrome:

firstPaint: 1411307463455.813 // New
firstPaintTime: 685.0390625 // New
appcacheTime: 2
connectEnd: 1411307463185
connectStart: 1411307463080
connectTime: 105 // New
domComplete: 1411307463437
domContentLoadedEventEnd: 1411307463391
domContentLoadedEventStart: 1411307463391
domInteractive: 1411307463391
domLoading: 1411307463365
domReadyTime: 46 // New
domainLookupEnd: 1411307463080
domainLookupStart: 1411307463032
fetchStart: 1411307463030
initDomTreeTime: 56 // New
loadEventEnd: 1411307463445
loadEventStart: 1411307463437
loadEventTime: 8 // New
loadTime: 558 // New
lookupDomainTime: 48
navigationStart: 1411307462887
readyStart: 143 // New
redirectEnd: 0
redirectStart: 0
redirectTime: 0 // New
requestStart: 1411307463185
requestTime: 150 // New
responseEnd: 1411307463335
responseStart: 1411307463333
secureConnectionStart: 1411307463130
unloadEventEnd: 0
unloadEventStart: 0
unloadEventTime: 0 // New

Firefox:

IE 11:

Build

Run npm install to install necessary dependencies for building the library. Check that npm run jshint doesn't throw any exceptions and then run npm run minify to minify.

License

Released under an MIT license.

概覽

名稱與所有者addyosmani/timing.js
主編程語言JavaScript
編程語言JavaScript (語言數: 1)
平台
許可證Other
發布數7
最新版本名稱1.2.0 (發布於 2016-12-19 13:16:55)
第一版名稱v1.0.0 (發布於 2014-09-22 15:18:05)
創建於2014-09-21 12:02:37
推送於2020-04-02 05:05:27
最后一次提交2020-04-01 22:05:25
星數1.5k
關注者數43
派生數123
提交數83
已啟用問題?
問題數19
打開的問題數8
拉請求數8
打開的拉請求數2
關閉的拉請求數7
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?
去到頂部