#!/bin/bash
#########################################################
# 							#
# This is BashStyle-NG  				#
#							#
# Licensed under GNU GENERAL PUBLIC LICENSE v3    	#
#							#
# Copyright 2007 - 2017 Christopher Bratusek		#
#							#
#########################################################

case ${1} in

	-h | --help )
		bashstyle-help -a "Christopher Roy Bratusek" -e "nano@jpberlin.de" -h "http://www.nanolx.org/"\
			-l "GNU GPL v3" -n "stopwatch" -s "a simple stopwatch" -v "${BSNG_VERSION}" -y "${BSNG_YEAR}"\
			-o "none:|--"
	;;

	*)
		BEGIN=$(date +%s)

		while true; do
			NOW=$(date +%s)
			DIFF=$((NOW-BEGIN))
			MINS=$((DIFF/60))
			SECS=$((DIFF%60))
			echo -ne "Time elapsed: $MINS:$(printf %02d $SECS)\r"
			sleep .1
		done
	;;

esac
