Skip to content

About

A simple stopwatch alias for bash

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

stopwatch-for-bash

A simple stopwatch alias for bash

usage

Execute the script

./sw.sh

Copy or link to your path

Use as an alias

alias sw='echo "#### StopWatch #####";a=`date +%s`;while true; do b=`date +%s`;bn=`date +%3N`;date -d@"$(($b - $a))" -u +%H:%M:%S|tr -d "\n";echo -n ".$bn";sleep .1;echo -en "\r";done'

Add the alias to .bashrc

Version for macos

brew install coreutils # we need gdate

alias sw='echo "#### StopWatch #####";a=`gdate +%s`;while true; do b=`gdate +%s`;bn=`gdate +%3N`;gdate -d@"$(($b - $a))" -u +%H:%M:%S|tr -d "\n";echo -n ".$bn";sleep .1;echo -en "\r";done'

About

A simple stopwatch alias for bash

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages