Generating 10 minutes by visual basic6

Thread Starter

Bluestar88

Joined Nov 16, 2014
23
I gonna produce 10 minutes in visual basic. But I don't want to use timer. I gonna do it with time of computer. I think they use Time( ) function. But I don't know how? Maybe I should S = Time() and then read the time of computer again and then when the difference of them is 10 minutes. What is its code? Can anyone help me?
 

RamaD

Joined Dec 4, 2009
328
"I gonna produce 10 minutes in visual basic" is not clear.

time()
will give you current time in the format as per system settings.

time() + timeserial(hours, minutes, seconds)
will give you time after hours, minutes & seconds as the parameters given.

Declare the variables as Date type.

You can keep wasting CPU cycles by checking for whether time() has become equal to what you had calculated.
Use Doevents to release the cpu for doing something more useful:)
Word of Caution -
If the CPU has been busy for that second and not executed your line, then this may not work. For that make the time() > your calculated time.
time() function with time arithmetic does not work well during overflows of days! You can use now() function instead of time().
Dateserial() is another function similiar to timeserial() for days!
 
Top