https://github.com/himenon/exectime-js
Tool to measure execution time of CLI and JavaScript
https://github.com/himenon/exectime-js
perfomance-js shell
Last synced: 2 months ago
JSON representation
Tool to measure execution time of CLI and JavaScript
- Host: GitHub
- URL: https://github.com/himenon/exectime-js
- Owner: Himenon
- License: mit
- Created: 2020-11-11T05:04:13.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-17T15:00:55.000Z (over 5 years ago)
- Last Synced: 2025-08-27T21:58:00.152Z (10 months ago)
- Topics: perfomance-js, shell
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@himenon/ticktack
- Size: 102 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# @himenon/exectime
Tool to measure execution time of CLI and JavaScript.
It supports both the browser and NodeJS environments.
## Install
```bash
yarn global add @himenon/exectime
```
## CLI
```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"
```
### Show current settings
```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
```
## API
```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();
```
## 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
- [Proxy Directory](https://himenon.github.io/docs/javascript/proxy-directory-design-pattern/)
## Release
- Automatic version updates are performed when merged into the `main` branch.
## LICENCE
[@himenon/exectime](https://github.com/Himenon/exectime-js)・MIT