[Solved] Counter with delay

Hi all,


EDIT:
found solution here:


How would I script a counter with an input number as the amount of time to delay (for instance, every 3 seconds) before the next value is output?
Right now the counter is simply just solving nonstop with no delay counter.gh (3.3 KB):

if(reset)
      counter = 0;
    if(run)
    {
      Component.ExpireSolution(true);
      Component.Message = "Count: " + counter.ToString();
      counter += 1;
    }
    else
      Component.Message = "Stopped";
    i = counter;
  }

  // <Custom additional code> 
  int counter;
  // </Custom additional code> 

Thanks!