({{, StartScheduledTask[obj] 
starts the local or cloud scheduled task represented by obj.}})

OpenersNotesSection(Spacer1)Details

obj can be a (RefLink[ScheduledTaskObject, paclet:ref/ScheduledTaskObject]) expression or a (RefLink[CloudObject, paclet:ref/CloudObject]) containing a (RefLink[ScheduledTask, paclet:ref/ScheduledTask]) expression or (RefLink[DocumentGenerator, paclet:ref/DocumentGenerator]).

StartScheduledTask returns a (RefLink[ScheduledTaskObject, paclet:ref/ScheduledTaskObject]) or (RefLink[CloudObject, paclet:ref/CloudObject]) expression representing the started task.

StartScheduledTask has attribute (RefLink[Listable, paclet:ref/Listable]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (5)

OpenersExampleSection0(Spacer1)Basic Examples  (4)

Temporarily stop the task:

n=0;Dynamic[n]
t=CreateScheduledTask[n++,{1,20}];

StartScheduledTask[t];Pause[4];StopScheduledTask[t];n=0;StartScheduledTask[t];

RemoveScheduledTask[t];

Non-synchronized tasks:

i=0;
RunScheduledTask[++i, 1];
RunScheduledTask[i=0,4];
Dynamic[i]

Better synchronization:

j=0;
StartScheduledTask[{CreateScheduledTask[++j, 1],CreateScheduledTask[j=0,4]}];
Dynamic[j]

RemoveScheduledTask[ScheduledTasks[]];

Create a task with random wait periods:

time:=RandomInteger[{1,3}]

fun[t_]:=Print["Waiting ",t," seconds."]

RunScheduledTask[With[{t=time},ResetScheduledTask[$ScheduledTask,{t}];fun[t];StartScheduledTask[$ScheduledTask]],{1}];

RemoveScheduledTask[ScheduledTasks[]];

Create a task that restarts evaluation as soon as it finishes:

fun:=With[{t=RandomInteger[{1,3}]},Print["Waiting ",t," seconds."];Pause[t]]

RunScheduledTask[fun;StartScheduledTask[$ScheduledTask],{1}];

RemoveScheduledTask[ScheduledTasks[]];

OpenersExampleSection1(Spacer1)Scope  (1)

Use (RefLink[StartScheduledTask, paclet:ref/StartScheduledTask]) to recommence scheduled executions of a cloud scheduled task or document generator:

obj=CloudDeploy[ScheduledTask[TimeObject[],"Daily"]]

With[{task=obj},StopScheduledTask[task]]

ScheduledTaskActiveQ[obj]

Resume scheduled executions:

With[{task=obj},StartScheduledTask[task]]

ScheduledTaskActiveQ[obj]

Delete the task:

RemoveScheduledTask[obj]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[DocumentGenerator, paclet:ref/DocumentGenerator])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Date and Time Functions, paclet:tutorial/DateAndTimeFunctions])}, {▪(RefLinkPlain[Controlling Infinite Evaluation, paclet:tutorial/ControllingInfiniteEvaluation])}})}})