HISE Logo Forum
    • Categories
    • Register
    • Login

    Check if timer is running

    Scheduled Pinned Locked Moved Scripting
    4 Posts 3 Posters 338 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sakorada
      last edited by

      I have this timer running.
      Is there a method to check isTimerRuning ?

      var myTimer = Engine.createTimerObject();
      
      myTimer.setTimerCallback(function () {
      
        Console.print("Timer is running....")
      
      });
      masterTimer.startTimer(1000);
      
      
      
      1 Reply Last reply Reply Quote 0
      • ?
        A Former User
        last edited by

        You could add something like:

        var myTimer = Engine.createTimerObject();
        var isTimerRunning = 0;
        
        myTimer.setTimerCallback(function () {
        
          Console.print("Timer is running....")
        
        });
        masterTimer.startTimer(1000);
        isTimerRunning = 1;
        

        And whenever you call stopTimer, just set it to 0.

        Now you can reference it with if (isTimerRunning)

        S 1 Reply Last reply Reply Quote 1
        • S
          sakorada @A Former User
          last edited by sakorada

          @iamlamprey Thank you ... 😊
          And Hope to see

          myTimer.isTimerRuning();
          

          in the future.

          1 Reply Last reply Reply Quote 1
          • Christoph HartC
            Christoph Hart
            last edited by

            Yeah, that's trivial to add, there's already a function like this in the JUCE class.

            1 Reply Last reply Reply Quote 2
            • First post
              Last post

            57

            Online

            1.7k

            Users

            11.7k

            Topics

            101.8k

            Posts