This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

$ScheduledTask

$ScheduledTask
returns the current ScheduledTaskObject.
  • Outside of a scheduled task evaluation, $ScheduledTask remains unevaluated.
  • $ScheduledTask is used to refer to the task within a task evaluation, e.g., to learn the parameters or stop the task.
Print the running scheduled task object:
Print its time specification:
Remove the scheduled task automatically when it is not needed:
Create a task with random wait periods:
Create a task that restarts evaluation as soon as it finishes:
Synchronize scheduled tasks using an auxiliary task:
The auxiliary task was removed:
Stop all scheduled tasks:
Print the running scheduled task object:
In[1]:=
Click for copyable input
Out[1]=
Print its time specification:
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
 
Remove the scheduled task automatically when it is not needed:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
In[5]:=
Click for copyable input
Out[5]=
In[6]:=
Click for copyable input
 
Create a task with random wait periods:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
In[4]:=
Click for copyable input
 
Create a task that restarts evaluation as soon as it finishes:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
 
Synchronize scheduled tasks using an auxiliary task:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
The auxiliary task was removed:
In[5]:=
Click for copyable input
Out[5]=
Stop all scheduled tasks:
In[6]:=
Click for copyable input
New in 8