MATLAB Hilfe-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.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
Europa
Asien-Pazifik
Kontakt zu Ihrer lokalen Niederlassung