BUILT-IN MATHEMATICA SYMBOL
CreateScheduledTask
CreateScheduledTask[expr, time]
creates a task that will repeatedly evaluate expr every time seconds.
CreateScheduledTask[expr, {time}]
creates a task that will evaluate expr once after time seconds.
CreateScheduledTask[expr, {time, count}]
creates a task that will try evaluating expr once every time seconds up to count times total.
CreateScheduledTask[expr, timespec, start]
creates a task that will evaluate expr according to timespec starting at start time.
- CreateScheduledTask returns a ScheduledTaskObject expression representing the created task.
- CreateScheduledTask creates a task, but does not start it. The task can be started using StartScheduledTask.
- The start is taken to be the absolute time when the task is activated.
- The first evaluation of expr will occur time seconds after it is activated.
- If two tasks are scheduled to evaluate at the same time, the one added later will execute first.
- Scheduled task does not require a notebook front end to work.
- By default, if the time necessary to evaluate expr is larger than time, the next pending evaluation is skipped.
Create a task:
| Out[1]= |  |
Start the task:
| Out[2]= |  |
Stop and remove it:
| Out[3]= |  |
Create a task, which will evaluate
every second:
| Out[1]= |  |
Assign value to
:
Start the task:
| Out[3]= |  |
| Out[4]= |  |
Create a task that will be activated 5 seconds from the current time and will print 1 second later:
| Out[1]= |  |
Specify a date to activate the task:
| Out[1]= |  |
Non-synchronized tasks:
| Out[1]= |  |
Better synchronization:
| Out[2]= |  |
Synchronize tasks using an auxiliary task:
| Out[3]= |  |
The auxiliary task
was removed:
| Out[5]= |  |
Stop tasks:
Remove all tasks:
New in 8