function::task_stime - Linux


Overview

task_stime measures how long a process has spent in user mode. This includes the time spent in the process’s user-mode kernel helper threads. Therefore, this value is equivalent to the "utime" value reported by the getrusage or time calls, plus the time spent in the kernel helper threads.

Syntax

task_stime [PID]

Options/Flags

None

Examples

Example 1: Display the amount of time the current process has spent in user mode

task_stime $$

Example 2: Display the user mode time for a specific process

task_stime 1234

Common Issues

Error: task_stime: No such process

This error occurs when you try to measure the user mode time of a process that does not exist. Ensure that the PID provided is valid.

Integration

Combine with ps

Combine task_stime with ps to display the user mode time for a list of running processes:

ps -e -o pid,user,comm,task_stime

Related Commands

  • getrusage
  • time