OK. So here is the task at hand. I need this function to be able to return the milliseconds that it takes to time how long something takes to run. Assume that the rest of the program works to allow me to return (because it does). I just need to know what I am doing wrong due to the fact that it only outputs either the number "2" or a value similar to "3.163e+06". I just need a solid number. So, here is the method:
It takes the start and stop values from the both the start and stop member variables and subtracts them to get the difference. The issue is that it, again, just outputs one of the two aforementioned results...
Why do you store a difference of two time_ts and a difference of two longints in clock_t variables?? It isn't the problem here, I am just trying to understand the thought process.
As for the problems, to get the milliseconds, you need to multiply (not divide) seconds by a thousand and you need to divide (not multiply) nanoseconds by a million (not a thousand!)