Skip to content

Pinbib/QTimer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QTimer

A small program for tracking the execution time of commands.

Installation

To use, install the executable for your OS:

OS FILE TESTED
Windows HERE
Linux HERE
MacOS HERE

After downloading, After downloading, for Windows, open a terminal with administrator rights in the folder where the file was downloaded and execute the command:

move qtimer.exe C:/Windows/System32

For Linux, open a terminal in the folder where the file was downloaded and execute the following commands:

sudo mv qtimer /usr/local/bin

sudo chmode +x /usr/local/bin/qtimer

Using

To use, use the command:

qtimer [command]

  • [command]: String - The command whose time will be measured.

Example:

We have file index.js:

setTimeout(()=>console.log(1), 5000);

And we need to find out the time of its execution, to do this we will execute the following command:

qtimer node ./index.js

Or:

qtimer bun run ./index.js

We will get something like:

░██████╗░████████╗██╗███╗░░░███╗███████╗██████╗░
██╔═══██╗╚══██╔══╝██║████╗░████║██╔════╝██╔══██╗
██║██╗██║░░░██║░░░██║██╔████╔██║█████╗░░██████╔╝
╚██████╔╝░░░██║░░░██║██║╚██╔╝██║██╔══╝░░██╔══██╗
░╚═██╔═╝░░░░██║░░░██║██║░╚═╝░██║███████╗██║░░██║
░░░╚═╝░░░░░░╚═╝░░░╚═╝╚═╝░░░░░╚═╝╚══════╝╚═╝░░╚═╝

┌──────────────┬──────────────┬──────────┬───────┐
│        start │          end │ exitCode │  time │
├──────────────┼──────────────┼──────────┼───────┤
│ 19:37:52:323 │ 19:37:52:428 │        1 │ 105ml │
└──────────────┴──────────────┴──────────┴───────┘

Modes

It is also possible to specify in which mode the command will be launched:

qtimer [--mode] [command]

  • [--mode]: String - this is the mode in which the command will be executed (modes are not combined). There are two modes: --log, --count;

Mode: --log

If you use this mode, if your command outputs something, you will see it.

Example:

index.js:

setTimeout(()=>console.log(1), 5000);

qtimer --log node index.js

We will get something like:


░██████╗░████████╗██╗███╗░░░███╗███████╗██████╗░
██╔═══██╗╚══██╔══╝██║████╗░████║██╔════╝██╔══██╗
██║██╗██║░░░██║░░░██║██╔████╔██║█████╗░░██████╔╝
╚██████╔╝░░░██║░░░██║██║╚██╔╝██║██╔══╝░░██╔══██╗
░╚═██╔═╝░░░░██║░░░██║██║░╚═╝░██║███████╗██║░░██║
░░░╚═╝░░░░░░╚═╝░░░╚═╝╚═╝░░░░░╚═╝╚══════╝╚═╝░░╚═╝

1

┌──────────────┬─────────────┬──────────┬────────┐
│        start │         end │ exitCode │   time │
├──────────────┼─────────────┼──────────┼────────┤
│ 13:48:48:970 │ 13:48:54:65 │        0 │ 5095ml │
└──────────────┴─────────────┴──────────┴────────┘

Mode: --count

Using this mode, you can specify how many times your command will be executed.

qtimer --count [count] [count]

  • [count]: Number - how many times your command will be executed.

Example:

index.js:

setTimeout(()=>console.log(1), 5000);

qtimer --count 3 node index.js

We will get something like:


░██████╗░████████╗██╗███╗░░░███╗███████╗██████╗░
██╔═══██╗╚══██╔══╝██║████╗░████║██╔════╝██╔══██╗
██║██╗██║░░░██║░░░██║██╔████╔██║█████╗░░██████╔╝
╚██████╔╝░░░██║░░░██║██║╚██╔╝██║██╔══╝░░██╔══██╗
░╚═██╔═╝░░░░██║░░░██║██║░╚═╝░██║███████╗██║░░██║
░░░╚═╝░░░░░░╚═╝░░░╚═╝╚═╝░░░░░╚═╝╚══════╝╚═╝░░╚═╝

┌──────────────┬─────────────┬──────┬─────────┐
│        start │         end │ full │ average │
├──────────────┼─────────────┼──────┼─────────┤
│ 13:55:20:595 │ 13:55:36:64 │  15s │  5147ml │
└──────────────┴─────────────┴──────┴─────────┘

About

A small program for tracking the execution time of commands.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published