Skip to content
/ timeit Public
forked from marco-m/timeit

Measure the time of command execution, like /usr/bin/time, with human-friendly output and a periodic ticker

License

Notifications You must be signed in to change notification settings

isgasho/timeit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

timeit

The timeit utility measures the time of command execution.

It has some features inspired by the FreeBSD /usr/bin/time:

  1. Human friendly output (for example: 1h32m43s instead of 5563.00)

Examples

Time a command, with or without options:

$ timeit sleep 61
timeit results:
real: 1m1.008s

Time a shell construct: you have to time the execution of a subshell, for example:

$ timeit fish -c 'for i in (seq 3); sleep 1; echo $i; end'
1
2
3
timeit results:
real: 3.035s

Time a command and print intermediate timings:

$ timeit -ticker 30s sleep 60
timeit ticker: running since 30.001s
timeit ticker: running since 1m0.004s
timeit results:
real: 1m0.005s

Check online if there is a more recent version:

$ timeit -check-version
installed version v0.2.1 is older than the latest version v0.3.0
To upgrade visit https://github.com/marco-m/timeit

Status

Pre 1.0.0. Working and tested, backwards incompatible changes possible.

Supported platforms

Unix-like and macOS.

Install from binary package

  1. Download the archive for your platform from the releases page.
  2. Unarchive and copy the timeit executable somewhere in your $PATH. I like to use $HOME/bin/.

Install for macOS

You have to cope with the macOS gatekeeper, that will put the executable in quarantine, since it is not signed nor notarized. There are two options:

  1. Download the archive with a command-line tool, like curl or wget.
  2. Download the archive with a web browser, unarchive and run
    $ xattr -d com.apple.quarantine timeit
    

Install from source

  1. Install task.
  2. $ task

Then, copy the executable to a directory in your $PATH.

Making a release

$ env RELEASE_TAG=v0.1.0 summon task release

License

This code is released under the MIT license, see file LICENSE.

Credits

About

Measure the time of command execution, like /usr/bin/time, with human-friendly output and a periodic ticker

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%