6 Replies Latest reply on Jul 29, 2015 5:18 PM by LeonY

    setInterval(function,ms) Galileo Gen 2 Node Not working as intended

    LeonY

      Hi

      I have a very simple bit of code in NodeJS running on the Galileo Gen 2:

       

      setInterval(printSomething,1000);
      function printSomething()
      {
           console.log("something");
      }
      

       

      Every second, the above will output "something" to the console...

      if i reduce the time out

       

      setInterval(printSomething,500);
      function printSomething()
      {
           console.log("something");
      }
      

       

      Every half second, the above will output "something" to the console...

      However...

      If i reduce the timeout to something small like 100 or less it does not call the function 10 times per second or anywhere near it!! Is there something in the NodeJS engine on the Galileo that has a minimum value for this function? I can not make it go below 300, that is to say any value below 300 has the same effect as setting it to 300:

       

      setInterval(printSomething,100);
      function printSomething()
      {
           console.log("something");
      }
      

      Does the same as setInterval(printSomething,300);