Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: measuring elapsed time of a task evoked in a dos batch file  (Read 11178 times)

0 Members and 1 Guest are viewing this topic.

Squashman



    Specialist
  • Thanked: 134
  • Experience: Experienced
  • OS: Other
Re: measuring elapsed time of a task evoked in a dos batch file
« Reply #15 on: March 12, 2015, 07:33:18 AM »
Antonio posted a 2nd link that talks about the 24 hour problem.
Dave just added one line of code.
http://www.dostips.com/forum/viewtopic.php?f=3&t=6271
Quote from: miskox
What would be the best solution if I start the process before midnight and when time changes from 23:xx:xx to 00:xx:00 to have a correct time difference? Maybe adding 24 to hours? Or maybe adding dates to start time and end time?

Saso
Quote from: dbenham
Yes, assuming your process takes less than 24 hours to complete, then all you need to do is conditionally at 24 hours if elapsed is less than 0.
Code: [Select]
if %elapsed% lss 0 set /a elapsed+=24*60*60*100

Dave Benham