Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/andrew_beach_MMath/code/throw-empty.cpp

    r54651005 r49b3389  
    11// Throw Across Empty Function
    22#include <chrono>
     3#include <cstdio>
    34#include <cstdlib>
    45#include <exception>
    56#include <iostream>
     7#include <iomanip>
    68
     9using namespace std;
    710using namespace std::chrono;
    811
     
    1215        if (frames) {
    1316                unwind_empty(frames - 1);
     17                if (-1 == frames) printf("~");
    1418        } else {
    1519                throw (EmptyException){};
     
    3741        time_point<steady_clock> end_time = steady_clock::now();
    3842        nanoseconds duration = duration_cast<nanoseconds>(end_time - start_time);
    39         std::cout << "Run-Time (ns): " << duration.count() << std::endl;
     43        cout << "Run-Time (s): " << fixed << setprecision(1) << duration.count() / 1'000'000'000. << endl;
    4044}
Note: See TracChangeset for help on using the changeset viewer.