- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/code/throw-empty.cpp
r54651005 r49b3389 1 1 // Throw Across Empty Function 2 2 #include <chrono> 3 #include <cstdio> 3 4 #include <cstdlib> 4 5 #include <exception> 5 6 #include <iostream> 7 #include <iomanip> 6 8 9 using namespace std; 7 10 using namespace std::chrono; 8 11 … … 12 15 if (frames) { 13 16 unwind_empty(frames - 1); 17 if (-1 == frames) printf("~"); 14 18 } else { 15 19 throw (EmptyException){}; … … 37 41 time_point<steady_clock> end_time = steady_clock::now(); 38 42 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; 40 44 }
Note: See TracChangeset
for help on using the changeset viewer.