Skip to content
This repository has been archived by the owner on Mar 8, 2018. It is now read-only.
/ cputime Public archive

Run the command and measure the user CPU time it consumes.

Notifications You must be signed in to change notification settings

Garrit/cputime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cputime

Build Status

While the conventional time(1) is flexible and highly portable, it can only report CPU time consumed in hundredths of seconds. In an online judge context, we'd like to be able to measure CPU time consumed in milliseconds. This simple utility evaluates the user CPU time used by a process, and prints it out in milliseconds.

Requirements

cputime requires a Linux environment for both compilation and execution as it depends on Linux-specific resource metrics.

Installation

make
sudo make install

...will compile the project and install the cputime binary to /usr/local/bin/cputime.

Conversely, the uninstall Make target will attempt to remove the binary.

Running

To evalate the execution time of a program with cputime, give the path to the program and its arguments as arguments to cputime. For example, to run a program /bin/foo with the argument bar, run

cputime /bin/foo bar

The execution time of /bin/foo in milliseconds will be the last line of output to stdout.

About

Run the command and measure the user CPU time it consumes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published