Skip to content

Commit

Permalink
v0.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
nicjansma committed Jan 13, 2015
1 parent bc8de06 commit d2d15e5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# UserTiming.js

v0.1.4
v0.1.5

Copyright 2014 Nic Jansma

Expand Down Expand Up @@ -55,7 +55,7 @@ usertiming.js is also available via [bower](http://bower.io/). You can install u

## Usage

Please see the [W3C UserTiming API Reference](http://www.w3.org/TR/user-timing/) for details on how to use the
Please see the [W3C UserTiming API Reference](http://www.w3.org/TR/user-timing/) for details on how to use the
UserTiming API.

To include the UserTiming.js polyfill, simply include it via a script tag:
Expand All @@ -66,22 +66,22 @@ To include the UserTiming.js polyfill, simply include it via a script tag:

## Disadvantages of UserTiming.js over native implementations

UserTiming.js provides a 100% functional JavaScript implementation of UserTiming. However, implementing the API in
UserTiming.js provides a 100% functional JavaScript implementation of UserTiming. However, implementing the API in
JavaScript has some disadvantages over native (built into the browser) implementations.

1. If the browser does not natively support
1. If the browser does not natively support
[DOMHighResolutionTimestamps / ``window.performance.now()``](http://www.w3.org/TR/hr-time/), UserTiming.js adds a
small shim (via the `Date` object) to mock this interface. However, DOMHighResolutionTimestamp provides higher
precision (0.1 milliseconds or better) than the native `Date` object can (1.0 millisecond -- or worse in older
browsers). So if `window.performance.now()` has to be mocked, it will not be as precise as native implementations.

2. UserTiming marks and measures are queried via the [PerformanceTimeline](http://www.w3.org/TR/performance-timeline/),
for example by using `getEntries()`, `getEntriesByType()` or `getEntriesByName()`. UserTiming.js adds these
for example by using `getEntries()`, `getEntriesByType()` or `getEntriesByName()`. UserTiming.js adds these
interfaces so you can query for marks and measures, but they obviously will not support any other PerformanceEntrys
such as [ResourceTiming](http://www.w3.org/TR/resource-timing/).

3. UserTiming.js is implemented in JavaScript, so it will be less performant than a native implementation. If you
are calling `mark()` or `measure()` at a high-rate, you might incur a performance cost from the UserTiming.js
3. UserTiming.js is implemented in JavaScript, so it will be less performant than a native implementation. If you
are calling `mark()` or `measure()` at a high-rate, you might incur a performance cost from the UserTiming.js
JavaScript implementation versus a native implementation.

## Tests
Expand All @@ -102,8 +102,8 @@ The tests can also be run in a web browser:

### W3C tests

The latest [W3C UserTiming tests](http://w3c-test.org/webperf/tests/#ut) (as of 2013-04-15) were copied into the
``test-w3c/`` directory and can be run in any browser to validate UserTiming.js. In browsers that natively support
The latest [W3C UserTiming tests](http://w3c-test.org/webperf/tests/#ut) (as of 2013-04-15) were copied into the
``test-w3c/`` directory and can be run in any browser to validate UserTiming.js. In browsers that natively support
UserTiming, UserTiming.js does not change anything so the tests will be running against the native browser interface.

The following changes were made to the W3C test suite to work with UserTiming.js:
Expand Down Expand Up @@ -131,3 +131,4 @@ Additional notes:
* v0.1.2 - 2014-02-19: Small bower.json fix
* v0.1.3 - 2014-08-07: Include dist/ dir in bower and npm packages
* v0.1.4 - 2014-10-28: Fix for Safari iOS 8
* v0.1.5 - 2015-01-12: Fix for FF 35
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "usertiming",
"version": "0.1.4",
"version": "0.1.5",
"homepage": "https://github.com/nicjansma/usertiming.js",
"authors": [
"Nic Jansma <nic@nicj.net>"
Expand Down
2 changes: 1 addition & 1 deletion dist/usertiming.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "W3C UserTiming polyfill",
"main": "./src/usertiming",
"author": "Nic Jansma",
"version": "0.1.4",
"version": "0.1.5",
"repository" : {
"type" : "git",
"url" : "http://github.com/nicjansma/usertiming.js.git"
Expand Down

0 comments on commit d2d15e5

Please sign in to comment.