Changeset 5a40e4e for doc/theses/andrew_beach_MMath/code/throw-empty.cpp
- Timestamp:
- Sep 9, 2021, 3:56:32 PM (4 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- d0b9247
- Parents:
- dd1cc02 (diff), d8d512e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/code/throw-empty.cpp
rdd1cc02 r5a40e4e 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.