C Board  

Go Back   C Board > General Programming Boards > C Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 03-11-2006, 03:00 PM   #1
Registered User
 
Aran's Avatar
 
Join Date: Aug 2001
Posts: 1,301
measuring system resources used by a function

I'm currently working on a project for my "Theory of Programming Languages" class. It requires us to write 2 programs, one to test a math function's speed and "system resources used" in Java, and one in C (using the same math function). I can do the timing part in C and Java fine, but i have no idea how to measure the system resources used by a function in either language. I'm particularly clueless about doing it in C, because i don't really know C very well. I have a reasonable understanding of C++... that's as close as I've gotten to C.

Does anyone have an idea of what I should do to measure the system resources used by a function? Google searches haven't turned up any relevant results from which i could garner any useful information. The project is due a week from wednesday. I've tried asking the professor what he means, but he is, simply put, a poor teacher--he just repeats "you have to measure system resources" without adding anything and or clarifying anything. My classmates seem to be as in the dark as I am.

Any help would be greatly appreciated.

I'm NOT asking to have code written for me. I just want people with more experience with programing than myself to interpret this assignment and perhaps clarify what i should do, point me to a relevant tutorial, or give me some tips.
Aran is offline   Reply With Quote
Old 03-13-2006, 05:35 PM   #2
Frequently Quite Prolix
 
dwks's Avatar
 
Join Date: Apr 2005
Location: Canada
Posts: 7,629
Quote:
Does anyone have an idea of what I should do to measure the system resources used by a function?
Like how much time it uses? Use a profiler, like gprof. Or time to time your whole program (under Linux). Or a Win32 function that does the same thing (I can give you the source for this if you want it).

As for "resources", if you mean memory, try a memory management package or something. [edit] Might help: http://www.cprogramming.com/debugging/valgrind.html [/edit]
__________________
dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell


Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net

My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, etc.

New project: nort
dwks is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting an error with OpenGL: collect2: ld returned 1 exit status Lorgon Jortle C++ Programming 6 05-08-2009 08:18 PM
My calculation, delete and update functions dont work (Programming language C) TKaeWoods C Programming 2 03-05-2009 10:25 AM
In over my head Shelnutt2 C Programming 1 07-08-2008 06:54 PM
Change this program so it uses function?? stormfront C Programming 8 11-01-2005 08:55 AM
I need help with passing pointers in function calls vien_mti C Programming 3 04-24-2002 10:00 AM


All times are GMT -6. The time now is 06:52 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22