TIME

Time the execution of one or more commands

TIME

Measure how long command lines take, or print the current time.

  • time: print a high-resolution clock value as <seconds> sec. This is not the date (see date).

  • time "<command>" …: run each command line in turn and print time{<command>} = <s> sec after each one. With more than one command it also prints time{TOTAL} = <s> sec. It stops at the first command that fails, and returns that command’s result.

Whether it is safe depends on the commands timed.

Hardware-validated

drivshell> time "sleep 1" "sleep 2"
Sleeping for 1 second
time{sleep 1} = 1.001134 sec
Sleeping for 2 seconds
time{sleep 2} = 2.002126 sec
time{TOTAL} = 3.003332 sec

Built-in help

Parameters: [<command> ...]
    Runs command(s) and displays how much time they took to run.
    Example: time "sleep 1" "sleep 2"
    If no command is specified, displays the current time.

Further reading

SDK-6.5.20 HSDK Getting Started Guide (GS-SDK6520-R), plus SDK-6.5.20/21/22 Release Notes (RN-SDK65xx-R), OpenBCM sdk-6.5.27/rc: rc.soc, config.bcm, td3_sanity.soc, cmd_td3_tr514_lr.soc, tr51/tr517_bcm56870_a0.soc, bcm_diag_info.soc …, BCM_SDK命令.