Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Kokkos::Timer

Duane Labreche edited this page Jul 27, 2018 · 2 revisions

Kokkos::Timer

Header File: Kokkos_Core.hpp

Usage:

Kokkos::Timer timer;
double time = timer.seconds();
timer.reset();

Timer is a simple construct to measure time.

Synopsis

class Timer {
  typedef Timer execution_policy;

  //Constructors
  Timer();
  Timer(Timer&&) = default;
  Timer(const Timer&) = default;
  ~Timer() = default;

  //Member functions
  double seconds(); 
  void reset();
};

Public Class Members

Constructors

  • Timer(): Default Constructor. Sets the start time.
  • void reset(): Resets the start time.
  • double seconds(): Returns the number of seconds since last call to reset() or construction.

Examples

  Timer timer;
  // ...
  double time1 = timer.seconds();
  timer.reset();
  // ...
  double time2 = timer.seconds();
Clone this wiki locally