OK, as reposted, I don't see anything obviously wrong. However, if you want an answer to the question from one of your replies:
Quote:
As written does it run the code based on a file that is 2 seconds old or less, including 0 seconds?
then by all means use the debugger to set breakpoints on various statements and find out yourself. Nobody here is going to take all that code and run it on their own systems just to see if it works. The best person to determine if it works is YOU.
PS, mathematically 0 seconds is <= 2 seconds so there's nothing you should change.
(edited)
Oh, one thing, remove the "UL" from this
(_int64)20000000UL
.
(__int64)20000000
is sufficient.
Also, why do you have a single "_" in the int64 declaration / typecast? I thought it was __int64 (two underscores)