MATLAB Help Center
Get task object from a worker running a task
t = getCurrentTask
t = getCurrentTask returns the parallel.Task object that the current worker is associated with. Use getCurrentTask to get information from the task during a computation, such as the running duration.
t
parallel.Task
getCurrentTask
If getCurrentTask is evaluated on a worker, t is a parallel.Task object. Otherwise, t is an empty double.
example
collapse all
Use getCurrentTask and RunningDuration property to find the running duration of the task that a worker is associated with.
RunningDuration
On a worker, use getCurrentTask to get the current task object t from a worker running the task t.
t = getCurrentTask;
Then, use the RunningDuration property to get the running duration of the task.
howLong = t.RunningDuration
[]
Task object, specified as a parallel.Task or empty double. When you use getCurrentTask on a worker, t is the parallel.Task object that the current worker is associated with. When you use getCurrentTask on the client, t is an empty double.
Data Types: parallel.Task
Introduced before R2006a
getAttachedFilesFolder | getCurrentCluster | getCurrentJob | getCurrentWorker
getAttachedFilesFolder
getCurrentCluster
getCurrentJob
getCurrentWorker
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
Europa
Asia-Pacifico
Contatta l’ufficio locale