---
name: "rt_get_time"
section: "3"
platform: "linux"
package: "rtlinux"
version: "2.0rel-1"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/rt_get_time/3"
---

# rt\_get\_time(3)

get the current time

## NAME

rt\_get\_time - get the current time

## WARNING

This is RTL v1.x compatibility function. Please do not use it for new programs.

## SYNOPSIS

```
#define MODULE
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/errno.h>
#include <linux/rt_sched.h>
```

**RTIME rt\_get\_time(void);**

## DESCRIPTION

**rt\_get\_time** returns the number of real-time clock ticks since system bootup.  This is primarily helpful in conjunction with the defined constant **RT\_TICKS\_PER\_SECOND** for scheduling real-time tasks.  For example, a time interval of 100 msecs could be referred to as

 RTIME intvl = (RT\_TICKS\_PER\_SECOND / 10);

Then, for example,

 rt\_task\_make\_periodic(&mytask, rt\_get\_time() + 5 \* intvl, intvl);

would schedule mytask to run at 100 msec intervals starting 500 msec from the present time.

## RETURN VALUE

The number of clock ticks since system bootup time is returned.

## ERRORS

None.

## SEE ALSO

[**rt\_get\_time**(3)](/rt_get_time/3.md), [**rt\_task\_make\_periodic**(3)](/rt_task_make_periodic/3.md)
