Ignore:
Timestamp:
Jul 7, 2021, 6:24:42 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
d83b266
Parents:
1f45c7d (diff), b1a2c4a (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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    r1f45c7d rc86ee4c  
    11// Throw Across Empty Function
     2#include <chrono>
     3#include <cstdlib>
    24#include <exception>
    3 #include <cstdlib>
     5#include <iostream>
     6
     7using namespace std::chrono;
    48
    59struct EmptyException : public std::exception {};
     
    1620        unsigned int times = 1;
    1721        unsigned int total_frames = 1;
    18         if (2 < argc) {
     22        if (1 < argc) {
    1923                times = strtol(argv[1], nullptr, 10);
    2024        }
    21         if (3 < argc) {
     25        if (2 < argc) {
    2226                total_frames = strtol(argv[2], nullptr, 10);
    2327        }
    2428
     29        time_point<steady_clock> start_time = steady_clock::now();
    2530        for (unsigned int count = 0 ; count < times ; ++count) {
    2631                try {
     
    3035                }
    3136        }
     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;
    3240}
Note: See TracChangeset for help on using the changeset viewer.