I'm a first year computer science student, writing a c++ program that bubble sorts an array of randomly assigned floats and then uses a binary chop search to find the value of the last element in the array (for consistency while timing the code).
I want to time the execution of the bubble sorting and binary chop searching, but the c++ standard time library will only give me second level precision, which isn't usable as this code executes in under 1 second most of the time.
I have found Boost and I'm trying to use that as a way of getting a sub-second precision timing of the execution of code using the microsecond clock in the Boost DateTime library. The code I am using is at http://pastebin.com/U8D0s2hb. When I execute this code, I get the following error from Visual Studio 2008:
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
The culprit appears to be getting the time as a ptime object, but I have no idea why as I have never seen a runtime check failure error before.
Any help appreciated, thanks.