GithubHelp home page GithubHelp logo

jun6000 / time-taken-to Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 86 KB

⏱️ Tells you the execution time taken by your command.

Home Page: https://www.npmjs.com/package/time-taken-to

License: MIT License

JavaScript 100.00%
timer-application execution-time nodejs measure-time hrtime speed execution performance time time-taken timer promise async-await async

time-taken-to's Introduction

time-taken-to

A simple idea I came up with while working on something else. Seemed like a fun mini-project, so decided to package it xD

ttt-demo

Installation

npm i -g time-taken-to

This installs the binary to PATH after which it can be accessed either using time-taken-to or ttt.

Alternatively, can be run using npx without local installation.

Usage

⚠️ If your command is interactive (requires runtime input), time-taken-to will stall and not do anything. This case is currently not handled and will be fixed in a later patch.
🟢 Hence if interactive, hard-code your command.

time-taken-to [OPTIONS] <your_command>

Measures the time taken to execute <your_command>.

ttt [OPTIONS] <your_command>

Also does the same thing.

Using npx,

npx time-taken-to <your_command>

<your_command> must be specified as a string if it consists of more than one word.

$ ttt "ls -s"

is different from

$ ttt ls -s

Options

The various available options can be viewed by running

ttt -h
  • --round-to or -r - Rounds off the result to the number of digits provided as argument. The default value is 6.
  • --show-stdou or -s - If specified, ttt also displays the stdout produced by the command.
  • --iterations or -i - Runs the command for the specified number of times and returns the average for a more accurate result. Default is 1.
  • --version or -v - Displays current version of time-taken-to.
  • --help or -h - Displays the help page.

time-taken-to's People

Contributors

jun6000 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.