Sign in to follow this  
Followers 0
Patyadigg

Timerinit vs Epochtime

4 posts in this topic

#1 ·  Posted (edited)

Hello all,

I have a simple timer program that displays time left and progress bar for a set timer. This timer resets once I click on that timed events icon.

To have timers persit on app close, I save the timers init value to an ini file, so if the timer app is closed/reopened, the timers will remain at correct position.

Everything works except once the PC is restarted, the subsequent timerinit/diff values are not in reference with the timerinit/diff values returned before PC shutdown.

Is there a compile option I have set wrong somewhere?   Can I seed timers so they are always in reference with each other? Or is this simply a limitation of timerinit and timerdiff?  

 

To fix this, I am planning to switch to epoch time, but I would like to learn more about timerinit and what the value it returns is based off of.

Edited by Patyadigg

Share this post


Link to post
Share on other sites



@Patyadigg TimerInit and TimerDiff are really just a measurement of elapsed time within the script (think stop watch). When you reboot the computer, you are of course going to lose that handle unless you are writing it out somewhere to a file. Even then, it would be difficult to accurately measure the amount of time the reboot takes.

If I understand you correctly (not always a given :) ) it sounds like _Now() or _NowTime() might be a better tool for your needs.

1 person likes this

When you're dead, you don't know you're dead - it's only difficult for those that know you. It's the same way when you're stupid...

My Scripts: SCCM UDFInclude Source with Compiled Script, Windows Firewall UDF

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Yup _NowCalc and _DateDiff will do exactly what I need.

Saves me a handle call to get epoch time TY. 

Edited by Patyadigg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0