🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

github.com/AmrSaber/timer

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/AmrSaber/timer

v0.0.0-20240507015930-a2c684ec55c2
Source
Go
Version published
Created
Source

CLI Timer

CLI tool that is very similar to sleep but it shows a timer with the remaining time (timer disappears when done).

demo

It is safe to set

alias sleep=timer

As it behaves exactly the same as sleep (and more).

Install

Go install

You can install the package from code with go by running:

go install github.com/AmrSaber/timer@latest

To uninstall, run:

rm $(which timer)

Download binary

You can also download and use your OS's related binary from releases.

Usage

Use as:

timer 10s

You can add multiple durations (including negative ones) and they will all be summed together to get the final timer duration.

Durations can have any of go duration suffexis (h, m, s, ms, us, ...) but whatever duration is given it is rounded to the closest second. If no suffix is given to a duration, then s is assumed.

Not providing any duration, providing wrong duration, or cancelling the timer before it's done (sending SIGINT signal with ctrl+c) results in exit code of 1; otherwise, exits with 0 exit code when timer is done.

FAQs

Package last updated on 07 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts