#!/bin/sh # $Id: mtime,v 1.2 2014/11/18 23:46:00 friedman Exp $ # Default TIME='\n*** Timing Information ***\n Elapsed time : %E CPU Time : %Ss kernel, %Us user Percent CPU : %P\n Page faults : %F major, %R minor Page size : %Z bytes\n Context switches : %w voluntary, %c involuntary Swaps : %W\n Shared text : %Xk Resident set size: %tk avg, %Mk max Avg total memory : %Kk Avg unshared mem : %pk stack, %Dk data\n I/O block ops : %I input, %O output Socket msgs : %r received, %s sent Signals received : %k\n Exit status: %x\n' # As of kernel 3.16 these are the only supported fields. TIME_linux='\n*** Timing Information ***\n CPU : %E real, %S sys, %U user (%P util) RSS : %Mk FLT : %F major, %R minor CTX : %w voluntary, %c involuntary I/O : %I / %O Exit : %x\n' case `uname -s` in Linux ) TIME=$TIME_linux ;; esac export TIME exec time ${1+"$@"} # eof