---
name: "rt_get_time"
section: "2"
platform: "linux"
package: "rtlinux-doc"
version: "1.0-2"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/rt_get_time"
---

# rt\_get\_time(2)

get the current time

## NAME

rt\_get\_time - get the current time

## 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**(2)](/rt_get_time/2.md), [**rt\_task\_make\_periodic**(2)](/rt_task_make_periodic/2.md)

## AUTHOR

This manual page was written by Jerry Epplin.

Copyright (C) 1997 Jerry Epplin, placed under the GNU General Public License, see the file copyright for details.
