Crates.io | dozr |
lib.rs | dozr |
version | 0.4.0 |
created_at | 2025-07-05 04:03:54.964199+00 |
updated_at | 2025-07-23 05:51:30.593608+00 |
description | A flexible `sleep`-like command-line utility for pausing execution with fun timing features. |
homepage | https://github.com/ShaneIsley/dozr |
repository | https://github.com/ShaneIsley/dozr |
max_upload_size | |
id | 1738736 |
size | 120,098 |
sleep
-like command-line utility for pausing execution with fun timing features.dozr
is a command-line utility that extends the functionality of the standard sleep
command, providing a variety of ways to pause execution, including waiting for a fixed duration, waiting until a specific time of day, or waiting for a duration sampled from a statistical distribution.
5s
, 100ms
).22:30:00
).1m
, 30s
).dozr
can be installed from crates.io using cargo
:
cargo install dozr
dozr
is designed to be a flexible and easy-to-use replacement for the standard sleep
command. Here are a few examples of how to use it:
dozr
vs. sleep
The standard sleep
command is simple, typically taking a single argument for the duration to wait (e.g., sleep 5
). While effective for basic pauses, dozr
extends this functionality significantly. The table below highlights key differences:
Feature | sleep |
dozr |
---|---|---|
Basic Duration | sleep 5 (seconds only) |
dozr d 5s (supports s , ms , m , h , etc.) |
Distribution-based | No | Yes (Normal, Exponential, Log-Normal, Pareto, Uniform, Triangular, Gamma) |
Time-based Wait | No | Yes (dozr at 22:30 ) |
Alignment | No | Yes (dozr a 1m ) |
Jitter | No | Yes (dozr d 10s -j 1s ) |
Probabilistic Wait | No | Yes (dozr d 30s -p 0.5 ) |
Verbose Output | No | Yes (dozr d 10s -v ) |
Wait for a fixed duration:
# Wait for 5 seconds
dozr d 5s
Wait for a duration sampled from a Normal distribution with a mean of 10 seconds and a standard deviation of 2 seconds:
# Wait for a duration sampled from a Normal distribution
dozr n 10s 2
Wait until 10:30 PM:
# Wait until 10:30 PM
dozr at 22:30
Add a random duration of jitter up to 1 second to a 10-second wait:
# Wait for 10 seconds with up to 1 second of jitter
dozr d 10s -j 1s
Wait for 30 seconds with a 50% probability of actually waiting:
# Wait for 30 seconds with a 50% probability
dozr d 30s -p 0.5
Display a progress bar while waiting:
# Wait for 10 seconds with a progress bar
dozr d 10s -v
Full Command | Alias(es) | Arguments | Example |
---|---|---|---|
duration |
d |
<TIME> |
dozr d 5s |
normal |
n |
<MEAN> <STD_DEV> |
dozr n 10s 2.5 |
exponential |
e |
<LAMBDA> |
dozr e 0.5 |
log-normal |
ln |
<MEAN> <STD_DEV> |
dozr ln 1s 0.5 |
pareto |
par |
<SCALE> <SHAPE> |
dozr par 1.0 2.0 |
uniform |
u |
<MIN> <MAX> |
dozr u 1s 10s |
triangular |
t |
<MIN> <MAX> <MODE> |
dozr t 0.0 10.0 5.0 |
gamma |
g |
<SHAPE> <SCALE> |
dozr g 2.0 1.5 |
align |
a , ali |
<INTERVAL> |
dozr a 1m |
at |
(none) | <HH:MM[:SS]> |
dozr at 22:30 |
Full Option | Short | Value | Description |
---|---|---|---|
--jitter |
-j |
<TIME> |
Adds a random amount of time up to <TIME> . Not applicable to align or at . |
--probability |
-p |
<FLOAT> |
The chance (0.0 to 1.0) that the wait will actually occur. |
--verbose |
-v |
[TIME] |
Shows progress. Can take an optional update interval (e.g., -v 1s ). |
--help |
-h |
(none) | Displays the help message for the command. |
--version |
-V |
(none) | Displays the application version. |
dozr
is licensed under the MIT License.