Question: I have an assignment where I need to make a benchmark program to test the performance of any processor with two sorting algorithms (an iterative one and a recursive one). The thing is my teacher told me I have to create three different programs (that is, 3 .c files), two with each sorting algorithm (both of them have to read integers from a text file separated with \n's and write the same numbers to another text file but sorted), and a benchmarking program. In the benchmark program I need to calculate the MIPs (million instructions per second) with the formula MIPs = NI/T\*10^6, where NI is the number of instructions and T is the time required to execute those instructions. I have to be able to estimate the time each algorithm will take on any processor by calculating its MIPs and then solving that equation for T, like EstimatedTime = NI/MIPs\*10^6.
My question is... how exactly do I measure the performance of a program with another program? I have never done something like that. I mean, I guess I can use the TIME functions in C and measure the time to execute X number of lines and stuff, but I can do that only if all 3 functions (2 sorting algorithms and 1 benchmark function) are in the same program. I don't even know how to start.

Oh and btw, I have to calculate the number of instructions by cross compiling the sorting algorithms from C to MIPS (the asm language) and counting how many instructions were used.

Any guidelines would be appreciated... I currently have these functions:

* readfile (to read text files with ints on them)
* writefile
* sorting algorithms

Answer: 
On the right side of the Sources Tab look for `Event Listener Breakpoints`, expand the Mouse events, and select the click event, chrome will go into debugger mode every time there's a click event
You can check on the `console` tab what triggers your error, and what will be the files involved.

Here's an example on Chrome : 

[Chrome console example](http://i.stack.imgur.com/4FXUv.png)

On the left, you got the file involved (VM998 for example) and the corresponding line (3, for example).

Hope it helps.