Chapter 7. Task Time Tapset
This tapset defines utility functions to query time related properties of the current tasks, translate those in miliseconds and human readable strings.
Name
function::task_utime — User time of the current task
Synopsis
function task_utime:long()
Description
Returns the user time of the current task in cputime. Does not include any time used by other tasks in this process, nor does it include any time of the children of this task.
Name
function::task_utime_tid — User time of the given task
Synopsis
function task_utime_tid:long(tid:long)
Arguments
tid
Thread id of the given task
Description
Returns the user time of the given task in cputime, or zero if the task doesn't exist. Does not include any time used by other tasks in this process, nor does it include any time of the children of this task.
Name
function::task_stime — System time of the current task
Synopsis
function task_stime:long()
Description
Returns the system time of the current task in cputime. Does not include any time used by other tasks in this process, nor does it include any time of the children of this task.
Name
function::task_stime_tid — System time of the given task
Synopsis
function task_stime_tid:long(tid:long)
Arguments
tid
Thread id of the given task
Description
Returns the system time of the given task in cputime, or zero if the task doesn't exist. Does not include any time used by other tasks in this process, nor does it include any time of the children of this task.
Name
function::cputime_to_msecs — Translates the given cputime into milliseconds
Synopsis
function cputime_to_msecs:long(cputime:long)
Arguments
cputime
Time to convert to milliseconds.
Name
function::msecs_to_string — Human readable string for given milliseconds
Synopsis
function msecs_to_string:string(msecs:long)
Arguments
msecs
Number of milliseconds to translate.
Description
Returns a string representing the number of milliseconds as a human readable string consisting of “XmY.ZZZs”, where X is the number of minutes, Y is the number of seconds and ZZZ is the number of milliseconds.
Name
function::cputime_to_string — Human readable string for given cputime
Synopsis
function cputime_to_string:string(cputime:long)
Arguments
cputime
Time to translate.
Description
Equivalent to calling: msec_to_string (cputime_to_msecs (cputime).
Name
function::task_time_string — Human readable string of task time usage
Synopsis
function task_time_string:string()
Description
Returns a human readable string showing the user and system time the current task has used up to now. For example “usr: 0m12.908s, sys: 1m6.851s”.
Name
function::task_time_string_tid — Human readable string of task time usage
Synopsis
function task_time_string_tid:string(tid:long)
Arguments
tid
Thread id of the given task
Description
Returns a human readable string showing the user and system time the given task has used up to now. For example “usr: 0m12.908s, sys: 1m6.851s”.