How to read the time from a timer

  • version

    1.0.0beta1

  • scope

    Example.

    This code is provided as example code for a user to base their code on.

  • description

    How to read the time from a timer

A timer is a xCORE resource with a 32-bit counter that is continually incremented at a rate of 100MHz. A timer can be declared as follows:

timer t;

Timers may be declared as local variables inside a function or as a global variables. An input statement can be used to read the value of a timer’s counter (i.e. read the current time):

unsigned int time;

t :> time;

This will input the current time from the timer t to the variable time.