# @himenon/exectime

> Tool to measure execution time of CLI and JavaScript

Latest version **0.2.1** (published 2020-11-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @himenon/exectime
pnpm add @himenon/exectime
yarn add @himenon/exectime
bun add @himenon/exectime
```

Provides the command `exectime`.

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2020-11-17 |
| First published | 2020-11-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 39.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Himenon |
| Maintainers | himenoglyph |
| Keywords | performance |

## Links

- npm: https://www.npmjs.com/package/@himenon/exectime
- Repository: git@github.com:Himenon/exectime-js
- Homepage: https://github.com/Himenon/exectime-js#readme
- Issues: https://github.com/Himenon/exectime-js/issues
- npm.io page: https://npm.io/package/@himenon/exectime

## Dependencies (3)

- [uuid](https://npm.io/package/uuid.md) 8.3.1
- [execa](https://npm.io/package/execa.md) 4.1.0
- [commander](https://npm.io/package/commander.md) 6.2.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.2.1 (latest) — 2020-11-17
- 0.2.0 — 2020-11-16

## 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

---
_Source: https://npm.io/package/@himenon/exectime · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
