0

I'm learning C and would like to get a sense for just how much faster some of my C code is than its python equivalent.

I'm running Ubuntu 12.04

2 Answers 2

2

From command line you can use "time" command. This will give you the execution time of that program in three separate mode (by default) - a. real time; b. user time; c. system time.

a. real time indicates how much time it took overall; b. user time indicates how much time it took executing at userspace c. system time indicates how much time it took executing at kernel space.

Above is the way to measure time from commnad line. You can also measure program execution time from in program - using system call like gettimeofday().

Sign up to request clarification or add additional context in comments.

Comments

1

You have the answer to your question there in the title: the time command will measure the time it takes for a command to complete.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.