https://github.com/bmedicke/tim
multifunction command line timer ⏳👨💻
https://github.com/bmedicke/tim
cli command-line command-line-tool go golang tcell timer utimer
Last synced: about 1 year ago
JSON representation
multifunction command line timer ⏳👨💻
- Host: GitHub
- URL: https://github.com/bmedicke/tim
- Owner: bmedicke
- Archived: true
- Created: 2022-04-21T08:18:32.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-25T11:43:11.000Z (over 3 years ago)
- Last Synced: 2025-02-13T17:22:32.697Z (over 1 year ago)
- Topics: cli, command-line, command-line-tool, go, golang, tcell, timer, utimer
- Language: Go
- Homepage:
- Size: 27.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# tim
Tim is a (not yet) multifunction command line timer with the following features:
* stopwatch
## installation
```sh
go install github.com/bmedicke/tim@latest
```
## usage
* `-s` stopwatch mode
* `-c` countdown mode
* `-t` timer mode (counts up)
* `-q` quite flag, surpresses output
* `-x` timer/countdown mode exits with 0 when pressing *q*
### `-s` stopwatch mode
```sh
# using the return value:
tim -s && echo yes || echo no
# q returns 0.
# ctrl-c returns 127.
```
### `-c` countdown mode
```sh
tim -c 10s
tim -c 10h5s # not all values need to be specified.
tim -c 1m1s # order does not matter.
# using the return value:
tim -c 10s && echo timer ran out || echo timer stopped early
# q returns 1 because the countdown was stopped early.
# ctrl-c returns 127.
# making q return 0:
tim -c 10s -x ; echo $?
# ctrl-c still returns 127.
```
## development
```sh
# use the pre-commit hook:
git config --local core.hooksPath .githooks
```