PTIME(1)

πŸ“¦
version 0.2.23 Β· 2 versions
, in fedora 44

πŸ’– PTIME(1) πŸ’–

okay so bestie, welcome to ptime β€” she's a General Commands Manual girlie and her whole entire job is literally just timing a command. iconic behavior, no cap. ✨


🌸 NAME 🌸

ptime β€” time a command ⏱️


πŸŽ€ SYNOPSIS πŸŽ€

ptime command [arg]...
ptime -p pidlist

✨ DESCRIPTION ✨

So like, if you don't pass -p, ptime runs the command you gave her with all the args you gave her, and then when that command is done-doing-its-thing, she writes the timing statistics to standard error. that's it, that's the whole vibe. πŸ’…

If you do pass -p, she switches modes and shows you a snapshot of the accumulated timing statistics for the processes you named. main character energy fr fr.

the good stuff (aka when /proc/[pid]/schedstat is available): the output includes nanosecond-precision scheduling statistics, which is giving precision:

  • cpu β€” on-CPU run time
  • lat β€” run-queue wait time
  • slp β€” all other sleep time, computed as real minus cpu minus lat

...plus each component's percentage of real time. 🌈

Now listen, a trailing * means the value came from a lower-precision source β€” but the percentages stay relative to real, so don't stress. 🫢

With -p, both real and slp carry a trailing * because the process start time from /proc is recorded in clock ticks (typically 10ms granularity). and the user and sys values always carry a trailing * because they're derived from clock-tick counters when reading from /proc, or from microsecond-precision rusage when timing a command directly. πŸ™ˆ

heads up bestie: these values may not sum exactly to cpu. it's not a bug, it's just how the math math's. πŸ’€

πŸ’… OPTIONS πŸ’…

  • -p pidlist β€” display a snapshot of timing statistics for the specified processes. the pidlist is a list of process IDs separated by commas, whitespace, or any combination of the two (e.g., "1,2", "1, 2", "1 2"). slay. ✨

πŸ¦‹ OPERANDS πŸ¦‹

  • command β€” the command to execute. go off king. πŸ‘‘
  • arg β€” arguments to the command. πŸ“
  • pidlist β€” a list of process IDs separated by commas, whitespace, or any combination of the two. A /proc/pid path may also be used, which means shell expansions like /proc/* can target all processes on the system. (yes, ALL of them. she's brave like that. 🧚)

🌟 EXIT STATUS 🌟

okay so exit status tea, let's get into it:

  • if the command is invoked successfully, ptime(1) returns the exit status of the command βœ…
  • if the command is terminated by a signal, ptime(1) returns 128 plus the signal number πŸ’€
  • if the command is not found, ptime(1) returns 127 😭
  • if the command is found but cannot be invoked, ptime(1) returns 126 πŸ™ˆ
  • if an error occurs in ptime(1) itself, ptime(1) returns 1 🫠

🌈 FILES 🌈

  • /proc/pid/* β€” process information and control files. that's where the lore lives. πŸ“

⭐ SEE ALSO ⭐

time(1), proc(5) β€” go read those too, they're lowkey obsessed with each other.


made with love by ptime 0.2.23, dated September 2026 β€” that's the version and the date bestie, write it down, periodt. πŸ’– stay timed, stay iconic, mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from