Skip to main content
added links
Source Link
rcollyer
  • 34.1k
  • 7
  • 94
  • 194

You could use RunScheduledTaskRunScheduledTask or its relatives for this. For example, to append a random integer to catch once every two seconds you could do something like

catch = {};
task = RunScheduledTask[AppendTo[catch, RandomInteger[10]], 2];

You could also use CreateScheduledTaskCreateScheduledTask which is similar to RunScheduledTask except that the task won't be started automatically after it's been created. You'll have to use StartScheduledTaskStartScheduledTask to start it manually.

To start and stop the scheduled task you can use StartScheduledTask[task] and StopScheduledTask[task], respectively, and RemoveScheduledTask[task] will remove the scheduled task once you're done with it.

Additional information about these functions is available in the Documentation CenterDocumentation Center.

You could use RunScheduledTask or its relatives for this. For example, to append a random integer to catch once every two seconds you could do something like

catch = {};
task = RunScheduledTask[AppendTo[catch, RandomInteger[10]], 2];

You could also use CreateScheduledTask which is similar to RunScheduledTask except that the task won't be started automatically after it's been created. You'll have to use StartScheduledTask to start it manually.

To start and stop the scheduled task you can use StartScheduledTask[task] and StopScheduledTask[task], respectively, and RemoveScheduledTask[task] will remove the scheduled task once you're done with it.

Additional information about these functions is available in the Documentation Center.

You could use RunScheduledTask or its relatives for this. For example, to append a random integer to catch once every two seconds you could do something like

catch = {};
task = RunScheduledTask[AppendTo[catch, RandomInteger[10]], 2];

You could also use CreateScheduledTask which is similar to RunScheduledTask except that the task won't be started automatically after it's been created. You'll have to use StartScheduledTask to start it manually.

To start and stop the scheduled task you can use StartScheduledTask[task] and StopScheduledTask[task], respectively, and RemoveScheduledTask[task] will remove the scheduled task once you're done with it.

Additional information about these functions is available in the Documentation Center.

Source Link
Heike
  • 36.1k
  • 3
  • 110
  • 157

You could use RunScheduledTask or its relatives for this. For example, to append a random integer to catch once every two seconds you could do something like

catch = {};
task = RunScheduledTask[AppendTo[catch, RandomInteger[10]], 2];

You could also use CreateScheduledTask which is similar to RunScheduledTask except that the task won't be started automatically after it's been created. You'll have to use StartScheduledTask to start it manually.

To start and stop the scheduled task you can use StartScheduledTask[task] and StopScheduledTask[task], respectively, and RemoveScheduledTask[task] will remove the scheduled task once you're done with it.

Additional information about these functions is available in the Documentation Center.