Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding total memory used and elapsed real-time

Status
Not open for further replies.

CalicoKitty

Programmer
Apr 19, 2003
2
US
I'm writing a program that analyzes several algorithms and need to find out how much memory is used and how much real-time has elapsed. Can I just use sbrk(0) before and after each algorithm to analyze the memory usage? Does anybody have any suggestions for the elapsed real-time usage? I can find CPU time. It's unbelievable how the small things can hang a programmer up!
 
I don't know if you need better data, but the shell builtin "time" might come in very handy. No memory information, but there are plenty of other proc tools for that.

It just occured to me that you may not be using a *NIX. If that's the case, shame on you.

>time ls
.somefiles morefiles etc
real 0m0.160s
user 0m0.050s
sys 0m0.080s
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top