Skip to content

Commit

Permalink
converted logTime to use ms as easier read
Browse files Browse the repository at this point in the history
  • Loading branch information
andyjaar committed Jan 8, 2019
1 parent a037b1a commit 41fd531
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ exports.handler = async function(event, context) {
let time;
const logTime = (msg) => {
if(msg) {
const diff = process.hrtime(time);
console.log(`${msg}: ${diff[0]}.${diff[1].toString().substr(0,2)}s`);
const diff = new Date().getTime() - time;
console.log(`${msg}: ${diff}ms`);
}
time = process.hrtime();
time = new Date().getTime();
}

context.callbackWaitsForEmptyEventLoop = false;
Expand Down

0 comments on commit 41fd531

Please sign in to comment.