Tool to measure execution time of CLI and JavaScript
npm install @himenon/exectimeTool to measure execution time of CLI and JavaScript.
It supports both the browser and NodeJS environments.
``bash`
yarn global add @himenon/exectime
`ts
export EXECTIME_OUTPUT_PATH="performance.json"
export EXECTIME_NAME="my"
// Use environment settings
exectime -c "sleep 2"
// Use argument settings
exectime -n "sleepCommand" -o "exectime.json" -c "sleep 5"
`
`bash`
$ exectime -n "sleepCommand" -o "exectime.json" -c "sleep 5" --show info,command,settings
output file path : exectime.json
name : sleepCommand
command : sleep 5
Show message type: info, command, settings
`ts
import * as Exectime from "@himenon/exectime";
const wait = async ms => new Promise(resolve => setTimeout(resolve, ms));
const perfWait = Exectime.wrapAsync(wait, { name: "wait", label: "timer" });
await Promise.all([perfWait(1000), perfWait(500), perfWait(1200), perfWait(1300)]);
await Exectime.getResult();
`
| scripts | description |
| :------------------------ | :------------------------------------------ |
| build | typescript build and create proxy directory |clean
| | clean up |format:code
| | prettier |format:yarn:lock
| | yarn.lock deduplicate |lerna:version:up
| | lerna version up |test
| | execute test:depcruise, test:jest |test:depcruise
| | dependency-cruiser's test |test:jest
| | jest test |ts
| | execute ts-node |release:github:registry
| | publish GitHub registry |release:npm:registry
| | publish npm registry |
- Automatic version updates are performed when merged into the main` branch.