8

I'm writing a user-defined function that includes a for-loop and would like to pause execution after every iteration. Is there some function that does this, like "pause" in MATLAB?

user90593
  • 2,465
  • 3
  • 14
  • 11
  • 4
    You could use `readline` to ask the user to hit `enter` after each iteration, but that's perhaps not what you are looking for. – Richard Hardy Feb 21 '15 at 10:57

1 Answers1

14

Yes, you can pause execution by using Sys.sleep(). So, to wait for one second: Sys.sleep(1).

Lincoln Mullen
  • 6,257
  • 4
  • 27
  • 30