@himenon/exectime
v0.2.1
Published
Tool to measure execution time of CLI and JavaScript
Downloads
2,112
Readme
@himenon/exectime
Tool to measure execution time of CLI and JavaScript. It supports both the browser and NodeJS environments.
Install
yarn global add @himenon/exectime
CLI
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"
Show current settings
$ 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
API
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();
Development
| 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 |
Features
Release
- Automatic version updates are performed when merged into the
main
branch.