Main Content


Create timer in real-time kernel

Since R2023b



timerObj = createTimer(RT.Kernel) creates a timer with default values in the kernel.


collapse all

This example shows how to create a timer in the real-time kernel.

Create the timer.

myTimer = createTimer(RT.Kernel)
myTimer = 

  Timer with properties:

        Parent: [1×1 RT.Kernel]
       Running: 0
      Priority: 100
        Period: 1.0000e-03
         Ticks: 0
    TimeToTick: 0

Input Arguments

collapse all

The RT.Kernel argument specifies the real-time kernel object.

Output Arguments

collapse all

The timerObj object represents the timer and provides timer information through object properties.

Version History

Introduced in R2023b