Changeset ee23a8d for doc/theses/andrew_beach_MMath
- Timestamp:
- Jul 5, 2021, 3:17:12 PM (2 years ago)
- Branches:
- ADT, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 11ad42f, e84ab3d
- Parents:
- b7763da
- Location:
- doc/theses/andrew_beach_MMath/code
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/code/CondMatch.java
rb7763da ree23a8d 30 30 } 31 31 32 long startTime = System.nanoTime(); 32 33 for (int count = 0 ; count < times ; ++count) { 33 34 try { … … 37 38 } 38 39 } 40 long endTime = System.nanoTime(); 41 System.out.println("Run-Time (ns) " + (endTime - startTime)); 39 42 } 40 43 } -
doc/theses/andrew_beach_MMath/code/CrossCatch.java
rb7763da ree23a8d 11 11 } 12 12 13 long startTime = System.nanoTime(); 13 14 for (int count = 0 ; count < times ; ++count) { 14 15 try { … … 20 21 } 21 22 } 23 long endTime = System.nanoTime(); 24 System.out.println("Run-Time (ns) " + (endTime - startTime)); 22 25 } 23 26 } -
doc/theses/andrew_beach_MMath/code/CrossFinally.java
rb7763da ree23a8d 9 9 } 10 10 11 long startTime = System.nanoTime(); 11 12 for (int count = 0 ; count < times ; ++count) { 12 13 try { … … 16 17 } 17 18 } 19 long endTime = System.nanoTime(); 20 System.out.println("Run-Time (ns) " + (endTime - startTime)); 18 21 } 19 22 } -
doc/theses/andrew_beach_MMath/code/ThrowEmpty.java
rb7763da ree23a8d 22 22 } 23 23 24 long startTime = System.nanoTime(); 24 25 for (int count = 0 ; count < times ; ++count) { 25 26 try { … … 29 30 } 30 31 } 32 long endTime = System.nanoTime(); 33 System.out.println("Run-Time (ns) " + (endTime - startTime)); 31 34 } 32 35 } -
doc/theses/andrew_beach_MMath/code/ThrowFinally.java
rb7763da ree23a8d 23 23 } 24 24 25 long startTime = System.nanoTime(); 25 26 for (int count = 0 ; count < times ; ++count) { 26 27 try { … … 30 31 } 31 32 } 33 long endTime = System.nanoTime(); 34 System.out.println("Run-Time (ns) " + (endTime - startTime)); 32 35 } 33 36 } -
doc/theses/andrew_beach_MMath/code/ThrowOther.java
rb7763da ree23a8d 34 34 } 35 35 36 long startTime = System.nanoTime(); 36 37 for (int count = 0 ; count < times ; ++count) { 37 38 try { … … 43 44 } 44 45 } 46 long endTime = System.nanoTime(); 47 System.out.println("Run-Time (ns) " + (endTime - startTime)); 45 48 } 46 49 } -
doc/theses/andrew_beach_MMath/code/cond-match-r.cfa
rb7763da ree23a8d 1 1 // Conditional Match (or Re-Raise) 2 #include <clock.hfa> 2 3 #include <exception.hfa> 4 #include <fstream.hfa> 3 5 #include <stdlib.hfa> 4 6 … … 24 26 unsigned int times = 1; 25 27 unsigned int total_frames = 1; 26 if ( 2< argc) {28 if (1 < argc) { 27 29 times = strtol(argv[1], 0p, 10); 28 30 } 29 if ( 3< argc) {31 if (2 < argc) { 30 32 total_frames = strtol(argv[2], 0p, 10); 31 33 } 32 34 35 Time start_time = time(); 33 36 for (unsigned int count = 0 ; count < times ; ++count) { 34 37 try { … … 38 41 } 39 42 } 43 Time end_time = time(); 44 sout | "Run-Time (ns): " | (end_time - start_time)`ns; 40 45 } -
doc/theses/andrew_beach_MMath/code/cond-match.cfa
rb7763da ree23a8d 1 1 // Conditional Match (or Re-Raise) 2 #include <clock.hfa> 2 3 #include <exception.hfa> 4 #include <fstream.hfa> 3 5 #include <stdlib.h> 4 6 … … 23 25 int main(int argc, char * argv[]) { 24 26 unsigned int times = 1; 25 if ( 2< argc) {27 if (1 < argc) { 26 28 times = strtol(argv[1], 0p, 10); 27 29 } 28 30 31 Time start_time = time(); 29 32 for (unsigned int count = 0 ; count < times ; ++count) { 30 33 try { … … 34 37 } 35 38 } 39 Time end_time = time(); 40 sout | "Run-Time (ns): " | (end_time - start_time)`ns; 36 41 } -
doc/theses/andrew_beach_MMath/code/cond-match.cpp
rb7763da ree23a8d 1 1 // Conditional Match (or Re-Raise) 2 #include <chrono> 3 #include <cstdlib> 2 4 #include <exception> 3 #include <cstdlib> 5 #include <iostream> 6 7 using namespace std::chrono; 4 8 5 9 struct EmptyException : public std::exception {}; … … 24 28 unsigned int times = 1; 25 29 unsigned int total_frames = 1; 26 if ( 2< argc) {30 if (1 < argc) { 27 31 times = strtol(argv[1], nullptr, 10); 28 32 } 29 if ( 3< argc) {33 if (2 < argc) { 30 34 total_frames = strtol(argv[2], nullptr, 10); 31 35 } 32 36 37 time_point<steady_clock> start_time = steady_clock::now(); 33 38 for (unsigned int count = 0 ; count < times ; ++count) { 34 39 try { … … 38 43 } 39 44 } 45 time_point<steady_clock> end_time = steady_clock::now(); 46 nanoseconds duration = duration_cast<nanoseconds>(end_time - start_time); 47 std::cout << "Run-Time (ns): " << duration.count() << std::endl; 40 48 } -
doc/theses/andrew_beach_MMath/code/cross-catch.cfa
rb7763da ree23a8d 1 1 // Cross a Try Statement with a Termination Handler 2 #include <clock.hfa> 2 3 #include <exception.hfa> 4 #include <fstream.hfa> 3 5 #include <stdlib.hfa> 4 6 … … 8 10 unsigned int times = 1; 9 11 unsigned int total_frames = 1; 10 if ( 2< argc) {12 if (1 < argc) { 11 13 times = strtol(argv[1], 0p, 10); 12 14 } 13 if ( 3< argc) {15 if (2 < argc) { 14 16 total_frames = strtol(argv[2], 0p, 10); 15 17 } 16 18 19 Time start_time = time(); 17 20 for (unsigned int count = 0 ; count < times ; ++count) { 18 21 try { … … 22 25 } 23 26 } 27 Time end_time = time(); 28 sout | "Run-Time (ns): " | (end_time - start_time)`ns; 24 29 } -
doc/theses/andrew_beach_MMath/code/cross-catch.cpp
rb7763da ree23a8d 1 1 // Cross a Try Statement with a Termination Handler 2 #include <chrono> 3 #include <cstdlib> 2 4 #include <exception> 3 #include <cstdlib> 5 #include <iostream> 6 7 using namespace std::chrono; 4 8 5 9 struct NotRaisedException : public std::exception {}; … … 7 11 int main(int argc, char * argv[]) { 8 12 unsigned int times = 1; 9 if ( 2< argc) {13 if (1 < argc) { 10 14 times = strtol(argv[1], nullptr, 10); 11 15 } 12 16 17 time_point<steady_clock> start_time = steady_clock::now(); 13 18 for (unsigned int count = 0 ; count < times ; ++count) { 14 19 try { … … 18 23 } 19 24 } 25 time_point<steady_clock> end_time = steady_clock::now(); 26 nanoseconds duration = duration_cast<nanoseconds>(end_time - start_time); 27 std::cout << "Run-Time (ns): " << duration.count() << std::endl; 20 28 } -
doc/theses/andrew_beach_MMath/code/cross-finally.cfa
rb7763da ree23a8d 1 1 // Cross a Try Statement With Finally Clause 2 #include <clock.hfa> 2 3 #include <exception.hfa> 4 #include <fstream.hfa> 3 5 #include <stdlib.hfa> 4 6 … … 6 8 unsigned int times = 1; 7 9 unsigned int total_frames = 1; 8 if ( 2< argc) {10 if (1 < argc) { 9 11 times = strtol(argv[1], 0p, 10); 10 12 } 11 if ( 3< argc) {13 if (2 < argc) { 12 14 total_frames = strtol(argv[2], 0p, 10); 13 15 } 14 16 17 Time start_time = time(); 15 18 for (unsigned int count = 0 ; count < times ; ++count) { 16 19 try { … … 20 23 } 21 24 } 25 Time end_time = time(); 26 sout | "Run-Time (ns): " | (end_time - start_time)`ns; 22 27 } -
doc/theses/andrew_beach_MMath/code/cross-resume.cfa
rb7763da ree23a8d 1 1 // Cross a Try Statement With Finally Clause 2 #include <clock.hfa> 2 3 #include <exception.hfa> 4 #include <fstream.hfa> 3 5 #include <stdlib.hfa> 4 6 … … 8 10 unsigned int times = 1; 9 11 unsigned int total_frames = 1; 10 if ( 2< argc) {12 if (1 < argc) { 11 13 times = strtol(argv[1], 0p, 10); 12 14 } 13 if ( 3< argc) {15 if (2 < argc) { 14 16 total_frames = strtol(argv[2], 0p, 10); 15 17 } 16 18 19 Time start_time = time(); 17 20 for (unsigned int count = 0 ; count < times ; ++count) { 18 21 try { … … 22 25 } 23 26 } 27 Time end_time = time(); 28 sout | "Run-Time (ns): " | (end_time - start_time)`ns; 24 29 } -
doc/theses/andrew_beach_MMath/code/resume-detor.cfa
rb7763da ree23a8d 1 1 // Throw Across Destructor 2 #include <clock.hfa> 2 3 #include <exception.hfa> 4 #include <fstream.hfa> 3 5 #include <stdlib.hfa> 4 6 … … 26 28 unsigned int times = 1; 27 29 unsigned int total_frames = 1; 28 if ( 2< argc) {30 if (1 < argc) { 29 31 times = strtol(argv[1], 0p, 10); 30 32 } 31 if ( 3< argc) {33 if (2 < argc) { 32 34 total_frames = strtol(argv[2], 0p, 10); 33 35 } 34 36 37 Time start_time = timeHiRes(); 35 38 for (int count = 0 ; count < times ; ++count) { 36 39 try { … … 40 43 } 41 44 } 45 Time end_time = timeHiRes(); 46 sout | "Run-Time (ns): " | (end_time - start_time)`ns; 42 47 } -
doc/theses/andrew_beach_MMath/code/resume-empty.cfa
rb7763da ree23a8d 1 1 // Resume Across Empty Function 2 #include <clock.hfa> 2 3 #include <exception.hfa> 4 #include <fstream.hfa> 3 5 #include <stdlib.hfa> 4 6 … … 9 11 void unwind_empty(unsigned int frames) { 10 12 if (frames) { 11 12 13 unwind_empty(frames - 1); 13 14 } else { … … 19 20 unsigned int times = 1; 20 21 unsigned int total_frames = 1; 21 if ( 2< argc) {22 if (1 < argc) { 22 23 times = strtol(argv[1], 0p, 10); 23 24 } 24 if ( 3< argc) {25 if (2 < argc) { 25 26 total_frames = strtol(argv[2], 0p, 10); 26 27 } 27 28 29 Time start_time = timeHiRes(); 28 30 for (int count = 0 ; count < times ; ++count) { 29 31 try { … … 33 35 } 34 36 } 37 Time end_time = timeHiRes(); 38 sout | "Run-Time (ns): " | (end_time - start_time)`ns; 35 39 } -
doc/theses/andrew_beach_MMath/code/resume-finally.cfa
rb7763da ree23a8d 1 1 // Throw Across Finally 2 #include <clock.hfa> 2 3 #include <exception.hfa> 4 #include <fstream.hfa> 3 5 #include <stdlib.hfa> 4 6 … … 22 24 unsigned int times = 1; 23 25 unsigned int total_frames = 1; 24 if ( 2< argc) {26 if (1 < argc) { 25 27 times = strtol(argv[1], 0p, 10); 26 28 } 27 if ( 3< argc) {29 if (2 < argc) { 28 30 total_frames = strtol(argv[2], 0p, 10); 29 31 } 30 32 33 Time start_time = timeHiRes(); 31 34 for (int count = 0 ; count < times ; ++count) { 32 35 try { … … 36 39 } 37 40 } 41 Time end_time = timeHiRes(); 42 sout | "Run-Time (ns): " | (end_time - start_time)`ns; 38 43 } -
doc/theses/andrew_beach_MMath/code/resume-other.cfa
rb7763da ree23a8d 1 1 // Resume Across Other Handler 2 #include <clock.hfa> 2 3 #include <exception.hfa> 4 #include <fstream.hfa> 3 5 #include <stdlib.hfa> 4 6 … … 24 26 unsigned int times = 1; 25 27 unsigned int total_frames = 1; 26 if ( 2< argc) {28 if (1 < argc) { 27 29 times = strtol(argv[1], 0p, 10); 28 30 } 29 if ( 3< argc) {31 if (2 < argc) { 30 32 total_frames = strtol(argv[2], 0p, 10); 31 33 } 32 34 35 Time start_time = timeHiRes(); 33 36 for (int count = 0 ; count < times ; ++count) { 34 37 try { … … 38 41 } 39 42 } 43 Time end_time = timeHiRes(); 44 sout | "Run-Time (ns): " | (end_time - start_time)`ns; 40 45 } -
doc/theses/andrew_beach_MMath/code/throw-detor.cfa
rb7763da ree23a8d 1 1 // Throw Across Destructor 2 #include <clock.hfa> 2 3 #include <exception.hfa> 4 #include <fstream.hfa> 3 5 #include <stdlib.hfa> 4 6 … … 25 27 unsigned int times = 1; 26 28 unsigned int total_frames = 1; 27 if ( 2< argc) {29 if (1 < argc) { 28 30 times = strtol(argv[1], 0p, 10); 29 31 } 30 if ( 3< argc) {32 if (2 < argc) { 31 33 total_frames = strtol(argv[2], 0p, 10); 32 34 } 33 35 36 Time start_time = timeHiRes(); 34 37 for (int count = 0 ; count < times ; ++count) { 35 38 try { … … 39 42 } 40 43 } 44 Time end_time = timeHiRes(); 45 sout | "Run-Time (ns): " | (end_time - start_time)`ns; 41 46 } -
doc/theses/andrew_beach_MMath/code/throw-detor.cpp
rb7763da ree23a8d 1 1 // Throw Across Destructor 2 #include <chrono> 3 #include <cstdlib> 2 4 #include <exception> 3 #include <cstdlib> 5 #include <iostream> 6 7 using namespace std::chrono; 4 8 5 9 struct EmptyException : public std::exception {}; … … 21 25 unsigned int times = 1; 22 26 unsigned int total_frames = 1; 23 if ( 2< argc) {27 if (1 < argc) { 24 28 times = strtol(argv[1], nullptr, 10); 25 29 } 26 if ( 3< argc) {30 if (2 < argc) { 27 31 total_frames = strtol(argv[2], nullptr, 10); 28 32 } 29 33 34 time_point<steady_clock> start_time = steady_clock::now(); 30 35 for (int count = 0 ; count < times ; ++count) { 31 36 try { … … 35 40 } 36 41 } 42 time_point<steady_clock> end_time = steady_clock::now(); 43 nanoseconds duration = duration_cast<nanoseconds>(end_time - start_time); 44 std::cout << "Run-Time (ns): " << duration.count() << std::endl; 37 45 } -
doc/theses/andrew_beach_MMath/code/throw-empty.cfa
rb7763da ree23a8d 1 1 // Throw Across Empty Function 2 #include <clock.hfa> 2 3 #include <exception.hfa> 4 #include <fstream.hfa> 3 5 #include <stdlib.hfa> 4 6 … … 18 20 unsigned int times = 1; 19 21 unsigned int total_frames = 1; 20 if ( 2< argc) {22 if (1 < argc) { 21 23 times = strtol(argv[1], 0p, 10); 22 24 } 23 if ( 3< argc) {25 if (2 < argc) { 24 26 total_frames = strtol(argv[2], 0p, 10); 25 27 } 26 28 29 Time start_time = timeHiRes(); 27 30 for (unsigned int count = 0 ; count < times ; ++count) { 28 31 try { … … 32 35 } 33 36 } 37 Time end_time = timeHiRes(); 38 sout | "Run-Time (ns): " | (end_time - start_time)`ns; 34 39 } -
doc/theses/andrew_beach_MMath/code/throw-empty.cpp
rb7763da ree23a8d 1 1 // Throw Across Empty Function 2 #include <chrono> 3 #include <cstdlib> 2 4 #include <exception> 3 #include <cstdlib> 5 #include <iostream> 6 7 using namespace std::chrono; 4 8 5 9 struct EmptyException : public std::exception {}; … … 16 20 unsigned int times = 1; 17 21 unsigned int total_frames = 1; 18 if ( 2< argc) {22 if (1 < argc) { 19 23 times = strtol(argv[1], nullptr, 10); 20 24 } 21 if ( 3< argc) {25 if (2 < argc) { 22 26 total_frames = strtol(argv[2], nullptr, 10); 23 27 } 24 28 29 time_point<steady_clock> start_time = steady_clock::now(); 25 30 for (unsigned int count = 0 ; count < times ; ++count) { 26 31 try { … … 30 35 } 31 36 } 37 time_point<steady_clock> end_time = steady_clock::now(); 38 nanoseconds duration = duration_cast<nanoseconds>(end_time - start_time); 39 std::cout << "Run-Time (ns): " << duration.count() << std::endl; 32 40 } -
doc/theses/andrew_beach_MMath/code/throw-finally.cfa
rb7763da ree23a8d 1 1 // Throw Across Finally 2 #include <clock.hfa> 2 3 #include <exception.hfa> 4 #include <fstream.hfa> 3 5 #include <stdlib.hfa> 4 6 … … 22 24 unsigned int times = 1; 23 25 unsigned int total_frames = 1; 24 if ( 2< argc) {26 if (1 < argc) { 25 27 times = strtol(argv[1], 0p, 10); 26 28 } 27 if ( 3< argc) {29 if (2 < argc) { 28 30 total_frames = strtol(argv[2], 0p, 10); 29 31 } 30 32 33 Time start_time = timeHiRes(); 31 34 for (int count = 0 ; count < times ; ++count) { 32 35 try { … … 36 39 } 37 40 } 41 Time end_time = timeHiRes(); 42 sout | "Run-Time (ns): " | (end_time - start_time)`ns; 38 43 } -
doc/theses/andrew_beach_MMath/code/throw-other.cfa
rb7763da ree23a8d 1 1 // Throw Across Other Handler 2 #include <clock.hfa> 2 3 #include <exception.hfa> 4 #include <fstream.hfa> 3 5 #include <stdlib.hfa> 4 6 … … 24 26 unsigned int times = 1; 25 27 unsigned int total_frames = 1; 26 if ( 2< argc) {28 if (1 < argc) { 27 29 times = strtol(argv[1], 0p, 10); 28 30 } 29 if ( 3< argc) {31 if (2 < argc) { 30 32 total_frames = strtol(argv[2], 0p, 10); 31 33 } 32 34 35 Time start_time = timeHiRes(); 33 36 for (int count = 0 ; count < times ; ++count) { 34 37 try { … … 38 41 } 39 42 } 43 Time end_time = timeHiRes(); 44 sout | "Run-Time (ns): " | (end_time - start_time)`ns; 40 45 } -
doc/theses/andrew_beach_MMath/code/throw-other.cpp
rb7763da ree23a8d 1 1 // Throw Across Other Handler 2 #include <chrono> 3 #include <cstdlib> 2 4 #include <exception> 3 #include <cstdlib> 5 #include <iostream> 6 7 using namespace std::chrono; 4 8 5 9 struct EmptyException : public std::exception {}; … … 22 26 unsigned int times = 1; 23 27 unsigned int total_frames = 1; 24 if ( 2< argc) {28 if (1 < argc) { 25 29 times = strtol(argv[1], nullptr, 10); 26 30 } 27 if ( 3< argc) {31 if (2 < argc) { 28 32 total_frames = strtol(argv[2], nullptr, 10); 29 33 } 30 34 35 time_point<steady_clock> start_time = steady_clock::now(); 31 36 for (int count = 0 ; count < times ; ++count) { 32 37 try { … … 36 41 } 37 42 } 43 time_point<steady_clock> end_time = steady_clock::now(); 44 nanoseconds duration = duration_cast<nanoseconds>(end_time - start_time); 45 std::cout << "Run-Time (ns): " << duration.count() << std::endl; 38 46 }
Note: See TracChangeset
for help on using the changeset viewer.