Skip to content

Commit

Permalink
docs & deps
Browse files Browse the repository at this point in the history
  • Loading branch information
vltansky committed Apr 27, 2020
1 parent 6871140 commit aadf760
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 6 deletions.
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,66 @@ setTimeout(()=>{
}, 800);
```
<img src="browser.png">

## UMD
```
<!DOCTYPE html>
<html>
<head>
<!-- <script crossorigin src="https://unpkg.com/elapsed-time-logger/lib/umd/index.js"></script> -->
<script src="../lib/umd/index.js"></script>
<script>
var elapsed = Elapsed_logger;
elapsed.start('test2');
setTimeout(()=>{
elapsed.end('test2');
}, 1300);
elapsed.start('test');
setTimeout(()=>{
elapsed.end('test');
}, 1300);
elapsed.start('testoverride');
setTimeout(()=>{
elapsed.end('testoverride', 'override label');
}, 100);
elapsed.start('vlad');
setTimeout(()=>{
const test = elapsed.get('vlad');
console.log(test);
}, 1200);
// ElapsedLogger is similliar to console.time() & console.timeEnd()
elapsed.start('label');
elapsed.start('timer label');
setTimeout(()=>{
elapsed.end('label');
elapsed.end('timer label');
}, 800);
// or use ElapsedLogger as an instance (recommended)
const elapsedTimer = elapsed.start();
// const elapsedTimer2 = elapsed.start();
console.log('smth');
setTimeout(()=>{
const t = elapsedTimer.get();
console.log(t);
// elapsedTimer2.end(chalk.green('you can use colors here, try chalk or colors packages:'));
elapsedTimer.end('finished:');
}, 800);
</script>
</head>
<body>
</body>
</html>
```
2 changes: 1 addition & 1 deletion lib/umd/index.js

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

6 changes: 3 additions & 3 deletions package-lock.json

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 @@ -55,7 +55,7 @@
},
"license": "MIT",
"dependencies": {
"browser-hrtime": "^1.0.0"
"browser-hrtime": "^1.0.3"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^7.1.3",
Expand Down
1 change: 0 additions & 1 deletion tests/umd.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html>

<head>
<!-- <script crossorigin src="https://unpkg.com/browser-hrtime/lib/umd/index.js"></script> -->
<!-- <script crossorigin src="https://unpkg.com/elapsed-time-logger/lib/umd/index.js"></script> -->
<script src="../lib/umd/index.js"></script>
<script>
Expand Down

0 comments on commit aadf760

Please sign in to comment.