Skip to content

A C++ script that allows you to do multiple execution time calculations

Notifications You must be signed in to change notification settings

ChesterOfTheSemester/Execution-Timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Execution Timer 1.0

This C++ script lets you do multiple execution timings.

Usage Example

To run a full execution timing, time should be called twice. First to define the start-time and later again to calculate the completion-time. It will be reset and be ready for re-use when it is called again.

#include <iostream>
#include "execution_timer.h"

int main()
{
  execution_timer.time(0x01);
  for (int i=0; i<1000000; i++);
  std::cout << "Completed in " << execution_timer.time(0x01) << "ms" << std::endl;

  execution_timer.time(0x02);
  for (int j=0; j<99999999; j++);
  std::cout << "Completed in " << execution_timer.time(0x02) << "ms" << std::endl;

  return 0;
}

Parameters and return value

A unique uuid for each timer is necessary for assigning timespans

long long time (int uuid = 0);

@return (long long) Returns time completion in milliseconds

About

A C++ script that allows you to do multiple execution time calculations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages