Ignore:
Timestamp:
Jul 5, 2021, 3:17:12 PM (3 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
11ad42f, e84ab3d
Parents:
b7763da
Message:

Added duration information (in nanoseconds) to EHM benchmarks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/andrew_beach_MMath/code/resume-empty.cfa

    rb7763da ree23a8d  
    11// Resume Across Empty Function
     2#include <clock.hfa>
    23#include <exception.hfa>
     4#include <fstream.hfa>
    35#include <stdlib.hfa>
    46
     
    911void unwind_empty(unsigned int frames) {
    1012        if (frames) {
    11 
    1213                unwind_empty(frames - 1);
    1314        } else {
     
    1920        unsigned int times = 1;
    2021        unsigned int total_frames = 1;
    21         if (2 < argc) {
     22        if (1 < argc) {
    2223                times = strtol(argv[1], 0p, 10);
    2324        }
    24         if (3 < argc) {
     25        if (2 < argc) {
    2526                total_frames = strtol(argv[2], 0p, 10);
    2627        }
    2728
     29        Time start_time = timeHiRes();
    2830        for (int count = 0 ; count < times ; ++count) {
    2931                try {
     
    3335                }
    3436        }
     37        Time end_time = timeHiRes();
     38        sout | "Run-Time (ns): " | (end_time - start_time)`ns;
    3539}
Note: See TracChangeset for help on using the changeset viewer.