---
name: "ACE_System_Time"
section: "3"
platform: "linux"
package: "libace-doc"
version: "5.0.7-4"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/ACE_System_Time"
---

# ACE\_System\_Time(3)

Defines the timer services of the OS interface to access the system time either on the local host or on the central time server in the network.

## NAME

ACE\_System\_Time -  Defines the timer services of the OS interface to access the system time either on the local host or on the central time server in the network.

## SYNOPSIS

```
#include <ace/System_Time.h>
class ACE_System_Time
{
  public:
    enum Sync_Mode { Jump, Adjust };
    ACE_System_Time (LPCTSTR poolname = ACE_DEFAULT_BACKING_STORE);
    ~ACE_System_Time (void);
    static int get_local_system_time (ACE_UINT32 &time_out);
    static int get_local_system_time (ACE_Time_Value &time_out);
    int get_master_system_time (ACE_UINT32 &time_out);
    int get_master_system_time (ACE_Time_Value &time_out);
    int sync_local_system_time (ACE_System_Time::Sync_Mode mode);
  private:
    typedef ACE_Malloc <ACE_MMAP_MEMORY_POOL, ACE_Null_Mutex> MALLOC;
    typedef ACE_Allocator_Adapter<MALLOC> ALLOCATOR;
    ALLOCATOR *shmem_;
    long *delta_time_;
};
```

## PUBLIC MEMBERS

```
ACE_System_Time (LPCTSTR poolname = ACE_DEFAULT_BACKING_STORE);
```

Default constructor.

```
~ACE_System_Time (void);
```

Default destructor.

```
static int get_local_system_time (ACE_UINT32 &time_out);
```

Get the local system time, i.e., the value returned by ACE\_OS::time.

```
static int get_local_system_time (ACE_Time_Value &time_out);
```

Get the local system time, i.e., the value returned by ACE\_OS::time.

```
int get_master_system_time (ACE_UINT32 &time_out);
```

Get the system time of the central time server.

```
int get_master_system_time (ACE_Time_Value &time_out);
```

Get the system time of the central time server.

```
int sync_local_system_time (ACE_System_Time::Sync_Mode mode);
```

synchronize local system time with the central time server using specified mode.

## PRIVATE MEMBERS

```
typedef ACE_Malloc <ACE_MMAP_MEMORY_POOL, ACE_Null_Mutex> MALLOC;
```

```
typedef ACE_Allocator_Adapter<MALLOC> ALLOCATOR;
```

```
ALLOCATOR *shmem_;
```

Our allocator (used for obtaining system time from shared memory).

```
long *delta_time_;
```

Pointer to delta time kept in shared memory.

## AUTHOR

Prashant Jain, Tim H. Harrison and Douglas C. Schmidt

## LIBRARY

ace
