{"id":20562165,"url":"https://github.com/totaljs/performancemeter","last_synced_at":"2025-10-18T13:06:39.518Z","repository":{"id":57322163,"uuid":"86969691","full_name":"totaljs/performancemeter","owner":"totaljs","description":"A simple JavaScript code performance monitor","archived":false,"fork":false,"pushed_at":"2022-05-21T14:33:33.000Z","size":20,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T03:23:59.630Z","etag":null,"topics":["javascript","meter","nodejs","performance"],"latest_commit_sha":null,"homepage":"https://www.totaljs.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/totaljs.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-02T07:10:38.000Z","updated_at":"2022-04-21T02:55:22.000Z","dependencies_parsed_at":"2022-08-25T22:42:34.652Z","dependency_job_id":null,"html_url":"https://github.com/totaljs/performancemeter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totaljs%2Fperformancemeter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totaljs%2Fperformancemeter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totaljs%2Fperformancemeter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totaljs%2Fperformancemeter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/totaljs","download_url":"https://codeload.github.com/totaljs/performancemeter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248895334,"owners_count":21179224,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","meter","nodejs","performance"],"created_at":"2024-11-16T04:09:29.474Z","updated_at":"2025-10-18T13:06:34.466Z","avatar_url":"https://github.com/totaljs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node.js Performance Meter\n\n[![NPM version][npm-version-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url] [![MIT License][license-image]][license-url]\n\nA simple JavaScript performance meter.\n\n- installation `$ npm install performancemeter`\n- www.totaljs.com\n\n```js\nconst Meter = require('performancemeter');\n\n// Optional\n// Meter.name('Bla bla bla');\n\n// NEW: restricts output data\n// Meter.multiple();\n\n// Optional, default: \"medium\" (other types: \"veryeasy\", \"easy\", \"medium\", \"hard\", \"veryhard\")\nMeter.mode('easy');\n// or sets 10 cycles, veryeasy === 100, easy = 100000, medium = 10000000, hard = 10000000000\nMeter.mode(10);\n\n// Meter.measure(TEST_NAME, function_test, [function_init]);\n// @TEST_NAME {String}\n// @function_test {Function}\n// @function_init {Function} optional, can contains init values\n\n// Example 1:\nMeter.measure('String.indexOf()', 'str.indexOf(\"meter\")', 'var str = \"Performance meter\"');\nMeter.measure('RegExp.test()', 'reg.test(str)', 'var reg = /meter/; var str = \"Performance meter');\n\n// Example 2:\nMeter.measure('String.indexOf()', () =\u003e str.indexOf('meter'), 'var str = \"Performance meter\"');\nMeter.measure('RegExp.test()', () =\u003e reg.test(str), 'var reg = /meter/; var str = \"Performance meter\"');\n\n// Example 3:\nMeter.measure('String.indexOf()', function() {\n\tstr.indexOf('meter');\n}, function() {\n\tvar str = 'Performance meter';\n});\n\nMeter.measure('RegExp.test()', function() {\n\treg.test(str);\n}, function() {\n\tvar reg = /meter/;\n\tvar str = 'Performance meter';\n});\n\n// Async example:\nMeter.measure('nextTick', function() {\n\tprocess.nextTick(NEXT);\n});\n\nMeter.measure('immediate', function() {\n\tsetImmediate(NEXT);\n});\n\n// NEW: With a custom counter\nMeter.measure('nextTick', function() {\n\tCOUNT++;\n\tprocess.nextTick(NEXT);\n});\n\nMeter.measure('immediate', function() {\n\tCOUNT++;\n\tsetImmediate(NEXT);\n});\n```\n\n## Contact\n\n- contact form \u003chttps://www.totaljs.com/contact/\u003e\n- \u003cinfo@totaljs.com\u003e\n\n[license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat\n[license-url]: license.txt\n\n[npm-url]: https://npmjs.org/package/performancemeter\n[npm-version-image]: https://img.shields.io/npm/v/performancemeter.svg?style=flat\n[npm-downloads-image]: https://img.shields.io/npm/dm/performancemeter.svg?style=flat\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotaljs%2Fperformancemeter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftotaljs%2Fperformancemeter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotaljs%2Fperformancemeter/lists"}