Unit/integration testing time sensitive C++ code
Is there a way to create unit/integration tests that not only test for correctness, but also test that steps were completed within a specific time period? 

For example:

    // MyTestSuite.h
    #include <cxxtest/TestSuite.h>
    class MyTestSuite : public CxxTest::TestSuite
    {
        public:
        void testTimeCriticalFunction(void)
        {
            TS_ASSERT_EQUALS(timeCriticalFunction(), correctValue);

            // timeCriticalFunction() must correctly return within 5 milliseconds
            TS_ASSERT_DID_COMPLETE_WITHIN_MILLISECONDS(timeCriticalFunction(), 5);
        }
    }

While the example is only one function, it would be ideal if there was a way to chain them together to perform integration testing on a longer sequence such that the test would return true if each step was correct and completed within the specified time as well as the overall group.

Sub-millisecond accuracy is preferred, but typical time requirements are between 5-15 milliseconds.
Unit/integration testing time sensitive C++ code
===

Is there a way to create unit/integration tests that not only test for correctness, but also test that steps were completed within a specific time period? 

For example:

    // MyTestSuite.h
    #include <cxxtest/TestSuite.h>
    class MyTestSuite : public CxxTest::TestSuite
    {
        public:
        void testTimeCriticalFunction(void)
        {
            TS_ASSERT_EQUALS(timeCriticalFunction(), correctValue);

            // timeCriticalFunction() must correctly return within 5 milliseconds
            TS_ASSERT_DID_COMPLETE_WITHIN_MILLISECONDS(timeCriticalFunction(), 5);
        }
    }

While the example is only one function, it would be ideal if there was a way to chain them together to perform integration testing on a longer sequence such that the test would return true if each step was correct and completed within the specified time as well as the overall group.

Sub-millisecond accuracy is preferred, but typical time requirements are between 5-15 milliseconds.