system and user time

A

andreil

How to capture system and user time in C++ (Linux)?
I am interested to obtain information how much processor time did it
take to execute my program
A
 
T

Tejas Kokje

You can use "time" command for your program UNIX/Linux

#time <your prog name>

This will give you the amount of time your program spent in user and
kernel mode in additon to wall clock time.

Other than this, you can use standard time system calls like
gettimeofday() at the start and end of your program and then find the
difference between two. This however will only give you wall clock time
and not kernel and user level timings.

Tejas Kokje
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,238
Latest member
Top CryptoPodcasts

Latest Threads

Top