Forum

Notifications
Clear all

Time Clock

2 Posts
2 Users
0 Reactions
60 Views
(@sswcharlie)
Posts: 2
Active Member
Topic starter
 

Hi

For a model railroad  scheduling project I want time based on about 75% faster  per day of computer clock.  That is a normal 4 hours would occur over 1 hour.   So the clock will only take one hour to read     4.00   or say over 4 hours actual time  and then read   16.00.   24 hour clock.  Only 1 day nothing into next day.

Start at zero hrs when button pressed, so computer time not usable.

Is there a timer I can set up and refer to in vba.    eg if arrival of train is due at 0830 but is 10 mins late then  0840 is recorded.

A bit different but comments would be appreciated.

Thanks

Charles Harris

 
Posted : 08/04/2018 4:09 am
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi Charles,

Sorry for the slow reply.

Attached is a workbook with a couple of subs that control the timing.  Just click on Start and Stop.  The elapsed time is displayed in A1.

As you requested the displayed elapsed time is 4 times faster than the real elapsed time.  You can control this by adjusting the value of SpeedUp in the VBA.

I've included, but commented out, lines that will display the elapsed time in seconds should you wish to use this, but as it is time is displayed in hh:mm:ss format.

This timer is not 100% precise as it will depend on a number of factors like how busy your PC is with other tasks, but it should suffice if you just want to time things to within a few seconds.

I haven't tested it beyond a few seconds so I couldn't say by how much the timing drifts if you were to time a prolonged period e.g. hours.

Regards

Phil

 
Posted : 15/04/2018 7:31 am
Share: