// Cross a Try Statement with a Termination Handler #include #include #include #include EHM_EXCEPTION(not_raised_exception)(); EHM_VIRTUAL_TABLE(not_raised_exception, not_vt); int main(int argc, char * argv[]) { unsigned int times = 1; volatile bool should_throw = false; if (1 < argc) { times = strtol(argv[1], 0p, 10); } Time start_time = timeHiRes(); for (unsigned int count = 0 ; count < times ; ++count) { try { asm volatile ("# try block"); if (should_throw) { throw (not_raised_exception){¬_vt}; } } catch (not_raised_exception *) { asm volatile ("# catch block"); } } Time end_time = timeHiRes(); sout | "Run-Time (ns): " | (end_time - start_time)`ns; }