Calculate time saved on using speed multipliers.
I wanted a simple solution to calculate how much time I could save by using speed multipliers during lectures. But, I did not want to hop onto the browser or even open up the calculator, or even do mind-maths for this. Thus, I tried making a simple solution which lives in the terminal.
To calculate saved time, you run the trim command as follows:
$ ts <duration> <speed>Here, <duration> represents the length of the video you are watching (using
any combination of <days>d, <hours>h, <minutes>m, and <seconds>s), and
<speed> is the speed multiplier; a float that can optionally be
suffixed with an x (for example, both 1.5x and 1.5 are valid). For
instance, if you are watching a 1-hour video at 2x speed, execute:
$ ts 1h 2xThis command outputs the time you saved by watching the video at 2x speed. You can also combine multiple duration indicators and apply floating-point multipliers, such as:
$ ts 1h30m 1.5xFor convenience, in some cases you might use floating-point numbers for the duration itself. For example:
# Equivalent to `2h 1.5x`.
$ ts 1.5h30m 1.5xIf you wish to calculate saved time for multiple durations at once using the same speed multiplier, separate the durations with a '+' sign:
$ ts 1h30m+2h50m 1.25x$ cargo install trimsec$ mise use -g cargo:trimsecStandalone binaries for this project are all available at the GitHub Releases page. The binaries are produced by automated GitHub Actions workflows on three distinct runners and should run on all their respective platforms.
For manual building, proceed with the following:
# Clone the repository.
$ git clone https://github.com/hitblast/trimsec.git
$ cd trimsec
# Output: target/release/ts
$ cargo build --releaseThis project is licensed under the MIT License.