Robotcode  1.0
Timer Class Reference

Timer class that works with the s626 board. More...

#include <Timer626.h>

List of all members.

Public Member Functions

 Timer (double dt=1)
 Constructor: default is 1ms update cycles.
void init (int lowchannel=1, int highchannel=4, int board=0)
 Initialize Timer on board 0, any combination of channels.
void reset (int i)
 reset timer number i to zero
void clear ()
 clear all timers and clocks
void countup ()
 Increase update count by update cycle.
void countupReal ()
 get the real time phatom or s626 device
double read (int number)
double readReal (int number)
double operator[] (int number)
double dt ()

Detailed Description

Timer class that works with the s626 board.

The class holds two clocks

  • one that counts up every update cycles by dt,
  • one that reads the "real" time from the s626 board Furthermore, it has 6 stop-watches (working on the first clock) that can be reset to zero as you wish. They simply remember when they got reset and give you the difference between the nowtime and their last resetting time. Usually the timers are used in the following fashion
  • 0: Timer that gives you the time from the start of the last block
  • 1: Timer that gives you the time from the start of the current trial
  • 2: Flexible event timer that you can use in MyTrial::control() to stop the time since the last event.
  • 3: USed by screen to keep track of the screen refresh rate
  • 4: Time elapsed since the last control loop call
  • 5: Time elapsed since the last data record was done.

Constructor & Destructor Documentation

Timer::Timer ( double  dt = 1)

Constructor: default is 1ms update cycles.

Timer storage class: Keeps track of number of update cycles and real time this version updates itself from the s626-board; Joern Diedrichsen, 2007 j.diedrichsen@bangor.ac.uk ----------------------------------------------------------------------- Constructor -----------------------------------------------------------------------


Member Function Documentation

void Timer::init ( int  low = 1,
int  high = 4,
int  board = 0 
)

Initialize Timer on board 0, any combination of channels.

----------------------------------------------------------------------- init -----------------------------------------------------------------------

< Timer is made up from 1A + 1B

void Timer::reset ( int  timer)

reset timer number i to zero

----------------------------------------------------------------------- reset: Sets a single timer to zero -----------------------------------------------------------------------

void Timer::clear ( )

clear all timers and clocks

----------------------------------------------------------------------- clear: Clears all the timers to zero -----------------------------------------------------------------------

void Timer::countupReal ( )

get the real time phatom or s626 device

----------------------------------------------------------------------- countup real: gets the real time from the s626 device -----------------------------------------------------------------------

double Timer::read ( int  number) [inline]
Parameters:
numberread clock 1, timer i
double Timer::readReal ( int  number) [inline]
Parameters:
numberread clock 2, timer i
double Timer::operator[] ( int  number) [inline]
Parameters:
numberread clock 1, timer i

The documentation for this class was generated from the following files: