8000 GitHub - hoop33/jobtimer: Times jobs, allows you to add metadata, and collects the job as a JSON string · GitHub
[go: up one dir, main page]

Skip to content
hoop33Public

About

Times jobs, allows you to add metadata, and collects the job as a JSON string

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

Repository files navigation

Job Timer

badge semantic-release

Times jobs, allows you to add metadata, and collects the job as a JSON string

Installation

$ npm install jobtimer

Usage

const { startTimedJob, endTimedJob } = require("jobtimer");

// Start a timed job
const start = startTimedJob({ msg: "myjob" });

// Run some long-running job
const result = await longRunningFunction();

// Add result to job
start.result = result;

// Log the results
console.log(endTimedJob(start));
// {"msg":"myjob","result":"myresult","tpt":137}

Note: tpt stands for Total Processing Time.

License

Copyright © 2020 Rob Warner Licensed under the MIT License

About

Times jobs, allows you to add metadata, and collects the job as a JSON string

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

0