Android Question Create a Faster Timer?

Discussion in 'Android Questions' started by HimeAnator, Apr 3, 2015.

  1. HimeAnator

    HimeAnator Member Licensed User

    I'm working on a simple project that turns the device screen into a flashing hazard light, I have gotten it to work using a timer and a two panels and implementing the code below...
    Code:
    Sub LightTimer_Tick
    If LightCount = 0 Then
    Panel1.Color = 
    Colors.ARGB(255,2551740)
    Panel2.Color = 
    Colors.white
    LightCount = 
    1
    Else
    Panel1.Color = 
    Colors.white
    Panel2.Color = 
    Colors.ARGB(255,2551740)
    LightCount = 
    0
    End If
    End Sub
    The panels alternate color, however 1 second is really too slow for what I am trying to achieve, I want them to change a lot more rapidly/faster. Is there anyway to have the timer tick faster, or is there another way I should go about this? Any help is much appreciated!
     
  2. NJDude

    NJDude Expert Licensed User

    Set a shorter interval when you initialize the timer, that's all.
     
    thedesolatesoul likes this.
  3. HimeAnator

    HimeAnator Member Licensed User

    I thought the shortest interval was "1000"
     
  4. HimeAnator

    HimeAnator Member Licensed User

    Oh wow ok I just set it "100" and it worked. I guess I should have at least attempted it before asking :D thank you!!!!!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice