Changeset 6ff08d8 for doc/theses/andrew_beach_MMath/code
- Timestamp:
- Jul 12, 2021, 1:44:35 PM (4 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 605673f, 9345684
- Parents:
- cf444b6 (diff), a953c2e3 (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. - Location:
- doc/theses/andrew_beach_MMath/code
- Files:
-
- 1 added
- 20 edited
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/code/CondCatch.java
rcf444b6 r6ff08d8 3 3 class EmptyException extends Exception {} 4 4 5 public class Cond Match {5 public class CondCatch { 6 6 static boolean should_catch = false; 7 7 … … 20 20 } 21 21 22 public static void main(String[] args) { 23 int times = 1; 24 int total_frames = 1; 25 if (0 < args.length) { 26 times = Integer.parseInt(args[0]); 27 } 28 if (1 < args.length) { 29 total_frames = Integer.parseInt(args[1]); 30 } 31 22 private static long loop(int times) { 23 long startTime = System.nanoTime(); 32 24 for (int count = 0 ; count < times ; ++count) { 33 25 try { … … 37 29 } 38 30 } 31 long endTime = System.nanoTime(); 32 return endTime - startTime; 33 } 34 35 public static void main(String[] args) { 36 int times = 1; 37 if (0 < args.length) { 38 times = Integer.parseInt(args[0]); 39 } 40 if (1 < args.length) { 41 should_catch = 0 != Integer.parseInt(args[1]); 42 } 43 44 // Warm-Up: 45 loop(1000); 46 47 long time = loop(times); 48 System.out.println("Run-Time (ns): " + time); 39 49 } 40 50 } -
doc/theses/andrew_beach_MMath/code/CrossCatch.java
rcf444b6 r6ff08d8 4 4 5 5 public class CrossCatch { 6 public static void main(String[] args) { 7 int times = 1; 8 boolean shouldThrow = false; 9 if (0 < args.length) { 10 times = Integer.parseInt(args[0]); 11 } 6 private static boolean shouldThrow = false; 12 7 8 private static long loop(int times) { 9 long startTime = System.nanoTime(); 13 10 for (int count = 0 ; count < times ; ++count) { 14 11 try { … … 20 17 } 21 18 } 19 long endTime = System.nanoTime(); 20 return endTime - startTime; 21 } 22 23 public static void main(String[] args) { 24 int times = 1; 25 if (0 < args.length) { 26 times = Integer.parseInt(args[0]); 27 } 28 29 // Warm-Up: 30 loop(1000); 31 32 long time = loop(times); 33 System.out.println("Run-Time (ns): " + time); 22 34 } 23 35 } -
doc/theses/andrew_beach_MMath/code/CrossFinally.java
rcf444b6 r6ff08d8 2 2 3 3 public class CrossFinally { 4 public static void main(String[] args) { 5 int times = 1; 6 boolean shouldThrow = false; 7 if (0 < args.length) { 8 times = Integer.parseInt(args[0]); 9 } 4 private static boolean shouldThrow = false; 10 5 6 private static long loop(int times) { 7 long startTime = System.nanoTime(); 11 8 for (int count = 0 ; count < times ; ++count) { 12 9 try { … … 16 13 } 17 14 } 15 long endTime = System.nanoTime(); 16 return endTime - startTime; 17 } 18 19 public static void main(String[] args) { 20 int times = 1; 21 if (0 < args.length) { 22 times = Integer.parseInt(args[0]); 23 } 24 25 // Warm-Up: 26 loop(1000); 27 28 long time = loop(times); 29 System.out.println("Run-Time (ns): " + time); 18 30 } 19 31 } -
doc/theses/andrew_beach_MMath/code/ThrowEmpty.java
rcf444b6 r6ff08d8 12 12 } 13 13 14 private static long loop(int times, int total_frames) { 15 long startTime = System.nanoTime(); 16 for (int count = 0 ; count < times ; ++count) { 17 try { 18 unwind_empty(total_frames); 19 } catch (EmptyException e) { 20 // ... 21 } 22 } 23 long endTime = System.nanoTime(); 24 return endTime - startTime; 25 } 26 14 27 public static void main(String[] args) { 15 28 int times = 1; … … 22 35 } 23 36 24 for (int count = 0 ; count < times ; ++count) { 25 try { 26 unwind_empty(total_frames); 27 } catch (EmptyException e) { 28 // ... 29 } 30 } 37 // Warm-Up: 38 loop(1000, total_frames); 39 40 long time = loop(times, total_frames); 41 System.out.println("Run-Time (ns): " + time); 31 42 } 32 43 } -
doc/theses/andrew_beach_MMath/code/ThrowFinally.java
rcf444b6 r6ff08d8 13 13 } 14 14 15 private static long loop(int times, int total_frames) { 16 long startTime = System.nanoTime(); 17 for (int count = 0 ; count < times ; ++count) { 18 try { 19 unwind_finally(total_frames); 20 } catch (EmptyException e) { 21 // ... 22 } 23 } 24 long endTime = System.nanoTime(); 25 return endTime - startTime; 26 } 27 15 28 public static void main(String[] args) { 16 29 int times = 1; … … 23 36 } 24 37 25 for (int count = 0 ; count < times ; ++count) { 26 try { 27 unwind_finally(total_frames); 28 } catch (EmptyException e) { 29 // ... 30 } 31 } 38 // Warm-Up: 39 loop(1000, total_frames); 40 41 long time = loop(times, total_frames); 42 System.out.println("Run-Time (ns): " + time); 32 43 } 33 44 } -
doc/theses/andrew_beach_MMath/code/ThrowOther.java
rcf444b6 r6ff08d8 24 24 } 25 25 26 private static long loop(int times, int total_frames) { 27 long startTime = System.nanoTime(); 28 for (int count = 0 ; count < times ; ++count) { 29 try { 30 unwind_other(total_frames); 31 } catch (EmptyException e) { 32 // ... 33 } catch (NotRaisedException e) { 34 // ... 35 } 36 } 37 long endTime = System.nanoTime(); 38 return endTime - startTime; 39 } 40 26 41 public static void main(String[] args) { 27 42 int times = 1; … … 34 49 } 35 50 36 for (int count = 0 ; count < times ; ++count) { 37 try { 38 unwind_other(total_frames); 39 } catch (EmptyException e) { 40 // ... 41 } catch (NotRaisedException e) { 42 // ... 43 } 44 } 51 // Warm-Up: 52 loop(1000, total_frames); 53 54 long time = loop(times, total_frames); 55 System.out.println("Run-Time (ns): " + time); 45 56 } 46 57 } -
doc/theses/andrew_beach_MMath/code/cond-catch.cfa
rcf444b6 r6ff08d8 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 } 30 if (2 < argc) { 31 should_catch = strtol(argv[2], 0p, 10); 32 } 28 33 34 Time start_time = timeHiRes(); 29 35 for (unsigned int count = 0 ; count < times ; ++count) { 30 36 try { … … 34 40 } 35 41 } 42 Time end_time = timeHiRes(); 43 sout | "Run-Time (ns): " | (end_time - start_time)`ns; 36 44 } -
doc/theses/andrew_beach_MMath/code/cond-catch.cpp
rcf444b6 r6ff08d8 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 {}; … … 23 27 int main(int argc, char * argv[]) { 24 28 unsigned int times = 1; 25 unsigned int total_frames = 1; 26 if (2 < argc) { 29 if (1 < argc) { 27 30 times = strtol(argv[1], nullptr, 10); 28 31 } 29 if ( 3< argc) {30 total_frames= strtol(argv[2], nullptr, 10);32 if (2 < argc) { 33 should_catch = strtol(argv[2], nullptr, 10); 31 34 } 32 35 36 time_point<steady_clock> start_time = steady_clock::now(); 33 37 for (unsigned int count = 0 ; count < times ; ++count) { 34 38 try { … … 38 42 } 39 43 } 44 time_point<steady_clock> end_time = steady_clock::now(); 45 nanoseconds duration = duration_cast<nanoseconds>(end_time - start_time); 46 std::cout << "Run-Time (ns): " << duration.count() << std::endl; 40 47 } -
doc/theses/andrew_beach_MMath/code/cond-fixup.cfa
rcf444b6 r6ff08d8 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 … … 23 25 int main(int argc, char * argv[]) { 24 26 unsigned int times = 1; 25 unsigned int total_frames = 1; 26 if (2 < argc) { 27 if (1 < argc) { 27 28 times = strtol(argv[1], 0p, 10); 28 29 } 29 if ( 3< argc) {30 total_frames= strtol(argv[2], 0p, 10);30 if (2 < argc) { 31 should_catch = strtol(argv[2], 0p, 10); 31 32 } 32 33 34 Time start_time = timeHiRes(); 33 35 for (unsigned int count = 0 ; count < times ; ++count) { 34 36 try { … … 38 40 } 39 41 } 42 Time end_time = timeHiRes(); 43 sout | "Run-Time (ns): " | (end_time - start_time)`ns; 40 44 } -
doc/theses/andrew_beach_MMath/code/cross-catch.cfa
rcf444b6 r6ff08d8 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 = timeHiRes(); 17 20 for (unsigned int count = 0 ; count < times ; ++count) { 18 21 try { … … 22 25 } 23 26 } 27 Time end_time = timeHiRes(); 28 sout | "Run-Time (ns): " | (end_time - start_time)`ns; 24 29 } -
doc/theses/andrew_beach_MMath/code/cross-catch.cpp
rcf444b6 r6ff08d8 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
rcf444b6 r6ff08d8 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 = timeHiRes(); 15 18 for (unsigned int count = 0 ; count < times ; ++count) { 16 19 try { … … 20 23 } 21 24 } 25 Time end_time = timeHiRes(); 26 sout | "Run-Time (ns): " | (end_time - start_time)`ns; 22 27 } -
doc/theses/andrew_beach_MMath/code/cross-resume.cfa
rcf444b6 r6ff08d8 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 = timeHiRes(); 17 20 for (unsigned int count = 0 ; count < times ; ++count) { 18 21 try { … … 22 25 } 23 26 } 27 Time end_time = timeHiRes(); 28 sout | "Run-Time (ns): " | (end_time - start_time)`ns; 24 29 } -
doc/theses/andrew_beach_MMath/code/resume-detor.cfa
rcf444b6 r6ff08d8 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
rcf444b6 r6ff08d8 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
rcf444b6 r6ff08d8 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
rcf444b6 r6ff08d8 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
rcf444b6 r6ff08d8 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
rcf444b6 r6ff08d8 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
rcf444b6 r6ff08d8 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
rcf444b6 r6ff08d8 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
rcf444b6 r6ff08d8 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
rcf444b6 r6ff08d8 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
rcf444b6 r6ff08d8 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.