Generating 10 minutes by visual basic6

Discussion in 'Programmer's Corner' started by Bluestar88, Jan 10, 2015.

  1. Bluestar88

    Thread Starter New Member

    Nov 16, 2014
    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?
  2. RamaD

    Active Member

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

    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!
    Bluestar88 likes this.
  3. ScottWang


    Aug 23, 2012
    I was uploaded the VB file -- the timer for testing, it can be your reference.
    Bluestar88 likes this.
  4. sirch2

    Well-Known Member

    Jan 21, 2013
    Why don't you want to use a Timer?
    Bluestar88 likes this.
  5. panic mode

    Senior Member

    Oct 10, 2011