source: frontend/node_modules/browser-process-hrtime/README.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 920 bytes
Line 
1# browser-process-hrtime
2
3Browser shim for Node.js `process.hrtime()`.
4See [documentation at nodejs.org](http://nodejs.org/api/process.html#process_process_hrtime)
5
6This module does not provide the same level of time precision as node.js, but provides a matching API and response format.
7
8### usage
9Use hrtime independent of environment (node or browser).
10It will use `process.hrtime` first and fallback if not present.
11```js
12const hrtime = require('browser-process-hrtime')
13const start = hrtime()
14// ...
15const delta = hrtime(start)
16```
17
18### monkey-patching
19You can monkey-patch `process.hrtime` for your dependency graph like this:
20```js
21process.hrtime = require('browser-process-hrtime')
22const coolTool = require('module-that-uses-hrtime-somewhere-in-its-depths')
23```
24
25### note
26This was originally pull-requested against [node-process](https://github.com/defunctzombie/node-process),
27but they are trying to stay lean.
Note: See TracBrowser for help on using the repository browser.