Time and memory

Aug 9, 2013 at 8:25am
Hi guys! I want to ask you how can I understand the time that my program needs to finish and how can I see how much memory it uses? Because in some exercise is said that there is time limit and for example I can use only 16 megabytes.
Aug 9, 2013 at 12:27pm
Calculating time could be done using the time-function and comparing the timebefore and after running, however it might be that your exercise is referring to the number of steps in your algorithm as that is independent of your actual hardware. Read up on things like Big-O notation for this:)
Aug 9, 2013 at 12:41pm
It varies depending on the OS you're using. What OS/language are you using?
Aug 9, 2013 at 4:33pm
Windows XP 32-bit and I use C++
Aug 9, 2013 at 8:36pm
You can use the Windows Performance Monitor to monitor what resources your program uses.

1. Go to the console and run:

perfmon

2. Click Add (the + button)

3. Select Process and select your process from the list.

4. Select counters:

% Process Time
% Privileged Time
Private Bytes
Page Faults Delta

Press Add.

Run the program and stop the collector when your program ends.

% Process Time shows the total CPU used by your program.
% Privileged Time shows the time executing system calls.
Private Bytes shows the memory used exclusively by your program.
Page Faults Delta shows how much paging your program is causing.

If you want further help please ask, but you have enough to get you started.
Last edited on Aug 9, 2013 at 8:37pm
Topic archived. No new replies allowed.