1.

Solve : Time management?

Answer»

Hi Folks.

I have small timer.
Need to enter a break adherance system.
I can simply count the time I started the program.
While running the file. In between I want to enter something like break.
So, that timer should continue to count. But, Let me also how much minute or hour I been on break. And when I come from break I can continue with normal work.

Here is the code


echo off
set sec=1
set min=0
set hour=0
color 70
:1
title %hour% : %min% : %sec% Vishal timer
set /a sec=%sec%+1
Echo %hour% : %min% : %sec% Vishal timer
ping -n 1 -w 900 1.1.1.1
cls
if %sec% EQU 60 set /a sec=0 & set /a min=%min%+1
if %min% equ 60 set /a min=0 & set /a hour=%hour%+1
goto :1


I want something that can record my break in between of this timer without STOPPING the timer in any point.


Thanks and regards
Vishu    open cmd
type Code: [Select]ver and TELL me result
type Code: [Select]echo %time% and tell me resultMicrosoft Windows XP [version 5.1.2600]

1:16:49.27if it doesn't need to run past midnight this works
Code: [Select]echo off
set /a x3=%x%
set /a HH=0
set /a MM=0
set /a SS=0
set /a HM=0
set /a MS=0
set /a HS=0
set /a SA=0
set HH1=%TIME:~0,2%
set MM1=%TIME:~3,2%
set SS1=%TIME:~6,2%
rem time consuming task here
set SS2=%TIME:~6,2%
set HH2=%TIME:~0,2%
set MM2=%TIME:~3,2%
set /a HH=%HH2%-%HH1%
set /a MM=%MM2%-%MM1%
set /a SS=%SS2%-%SS1%
if %HH%==0 goto alt
if %MM%==0 goto alt1
set /a HM=%HH%*60
set /a MS=%MM%*60
set /a HS=%HM%*60
set /a SA=%HS%+%MS%+%SS%
echo it took %SA% seconds
goto C

:alt
if %MM%==0 goto alt1
set /a MS=%MM%*60
set /a SA=%MS%+%SS%
echo it took %SA% seconds
goto C

:alt1
set /a SA=%SS%
echo it took %SA% seconds

:C
pause
exit
don't  add the
set /a x3=%x%
line cut and paste error SORRY.how about the time sheets? have you used it before..

Staff Time Management  
 

This is out of the figure.
Actually this is not the thing that I was asking.

I want something to check the break time while running the counter.
I want to input a word B that will start to count break.
when I return from break press S and it will save the time spent on break.
Counter still be continued. Will give me total time i logged in. I mean from the time I ran the file. Code: [Select]echo off
:77
choice /c:B /N
set /a HH=0
set /a MM=0
set /a SS=0
set /a HM=0
set /a MS=0
set /a HS=0
set /a SA=0
set HH1=%TIME:~0,2%
set MM1=%TIME:~3,2%
set SS1=%TIME:~6,2%
choice /c:S /N
set SS2=%TIME:~6,2%
set HH2=%TIME:~0,2%
set MM2=%TIME:~3,2%
for /l %%a in (1,1,9) do if %MM2%==0%%a set MM2=%%a
for /l %%a in (1,1,9) do if %HH2%==0%%a set HH2=%%a
for /l %%a in (1,1,9) do if %SS2%==0%%a set SS2=%%a
for /l %%a in (1,1,9) do if %MM1%==0%%a set MM1=%%a
for /l %%a in (1,1,9) do if %HH1%==0%%a set HH1=%%a
for /l %%a in (1,1,9) do if %SS1%==0%%a set SS1=%%a
set /a HH=%HH2%-%HH1%
set /a MM=%MM2%-%MM1%
set /a SS=%SS2%-%SS1%
if %HH%==0 goto alt
if %MM%==0 goto alt1
set /a HM=%HH%*60
set /a MS=%MM%*60
set /a HS=%HM%*60
set /a SA=%HS%+%MS%+%SS%
goto C

:alt
if %MM%==0 goto alt1
set /a MS=%MM%*60
set /a SA=%MS%+%SS%
goto C

:alt1
set /a SA=%SS%
:C
set h=0
set m=0
set s=0
:B
if %sa% lss 360 goto D
set /A h=%h%+1
set /A sa=%sa%-360
goto b
:D
if %sa% lss 60 goto E
set /A m=%m%+1
set /A sa=%sa%-60
goto D
:E
if %sa% lss 1 goto F
set /A s=%s%+1
set /A sa=%sa%-1
goto E
:F
cls
title %H% : %M% : %S%
echo %H% : %M% : %S%
pause > nul
cls
goto 77note needs choice  download in zip

[recovering disk space - old attachment deleted by admin] 

It's not working. Sorry you can check it yourself.is choice in windows\system32 folder



Discussion

No Comment Found