Running time for C++ program in SUSE Linux

Running time for C++ program in SUSE Linux

Page 1 of 1

3 Replies - 2777 Views - Last Post: 19 June 2009 - 10:03 PM Rate Topic: -----

#1 begood  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 19-June 09

Running time for C++ program in SUSE Linux

Posted 19 June 2009 - 03:14 AM

[font=Book Antiqua]
I run my Cpp codes for recognition and classification, in SUSE Linux.

I need to know the RUNNING time or computation cost of my program for further analysis.

HOW CAN I do it??

Please guide me in details if possible.

Best regards for your time.

BeGood
Is This A Good Question/Topic? 0
  • +

Replies To: Running time for C++ program in SUSE Linux

#2 moopet  Icon User is offline

  • binary decision maker
  • member icon

Reputation: 339
  • View blog
  • Posts: 1,185
  • Joined: 02-April 09

Re: Running time for C++ program in SUSE Linux

Posted 19 June 2009 - 03:32 AM

View Postbegood, on 19 Jun, 2009 - 09:14 AM, said:

[font=Book Antiqua]
I run my Cpp codes for recognition and classification, in SUSE Linux.

I need to know the RUNNING time or computation cost of my program for further analysis.

HOW CAN I do it??

Please guide me in details if possible.

Best regards for your time.

BeGood


Well, if you compile your program and call it "thingy", then you can run
 time ./thingy

from the console.
Was This Post Helpful? 1
  • +
  • -

#3 begood  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 19-June 09

Re: Running time for C++ program in SUSE Linux

Posted 19 June 2009 - 09:53 PM

thnx a lot Moopet. it works.
I read thr. man time -- but did not differentiate the user and sys time.

e.g,
real 15.001sec
user 13.890
sys 1.523

--- real is from start to end.
user and sys? not sure!
Was This Post Helpful? 0
  • +
  • -

#4 Dantheman  Icon User is offline

  • D.I.C Regular

Reputation: 34
  • View blog
  • Posts: 445
  • Joined: 27-May 09

Re: Running time for C++ program in SUSE Linux

Posted 19 June 2009 - 10:03 PM

Real time is the actual time that the program was executing.

User time is the time that CPU spent on the program itself.

System time is the time that CPU spent in the operating system, doing tasks on behalf of your program.

Edit: I'm not sure why you have (sys + user) > real. Common sense tells me that (user + sys) must be <= real, unless some CPU operations can be considered both as user and sys, which is not the case.

This post has been edited by Dantheman: 19 June 2009 - 10:15 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1