# OS_NS_time.h File Reference

`#include "ace/config-all.h"`
`#include "ace/OS_NS_errno.h"`
`#include "ace/Basic_Types.h"`
`#include "ace/os_include/os_time.h"`
`#include "ace/ACE_export.h"`
`#include "ace/OS_NS_time.inl"`

Include dependency graph for OS_NS_time.h:

This graph shows which files directly or indirectly include this file:

## Namespaces

namespace | ACE_OS

## A set of wrappers for operations on time.

ACE_NAMESPACE_INLINE_FUNCTION char * | asctime (const struct tm *tm)
ACE_NAMESPACE_INLINE_FUNCTION char * | asctime_r (const struct tm *tm, char *buf, int buflen)
ACE_NAMESPACE_INLINE_FUNCTION int | clock_gettime (clockid_t, struct timespec *)
ACE_NAMESPACE_INLINE_FUNCTION int | clock_settime (clockid_t, const struct timespec *)
ACE_NAMESPACE_INLINE_FUNCTION ACE_TCHAR * | ctime (const time_t *t)
ACE_NAMESPACE_INLINE_FUNCTION ACE_TCHAR * | ctime_r (const time_t *clock, ACE_TCHAR *buf, int buflen)
ACE_NAMESPACE_INLINE_FUNCTION double | difftime (time_t t1, time_t t0)
ACE_NAMESPACE_INLINE_FUNCTION ACE_hrtime_t | gethrtime (const ACE_HRTimer_Op=ACE_HRTIMER_GETTIME)
ACE_NAMESPACE_INLINE_FUNCTION struct tm * | gmtime (const time_t *clock)
ACE_NAMESPACE_INLINE_FUNCTION struct tm * | gmtime_r (const time_t *clock, struct tm *res)
ACE_NAMESPACE_INLINE_FUNCTION struct tm * | localtime (const time_t *clock)
ACE_Export struct tm * | localtime_r (const time_t *clock, struct tm *res)
ACE_Export time_t | mktime (struct tm *timeptr)
ACE_NAMESPACE_INLINE_FUNCTION int | nanosleep (const struct timespec *requested, struct timespec *remaining=0)
ACE_NAMESPACE_INLINE_FUNCTION size_t | strftime (char *s, size_t maxsize, const char *format, const struct tm *timeptr)
ACE_Export char * | strptime (char *buf, const char *format, struct tm *tm)
ACE_NAMESPACE_INLINE_FUNCTION time_t | time (time_t *tloc=0)
ACE_NAMESPACE_INLINE_FUNCTION long | timezone (void)
ACE_NAMESPACE_INLINE_FUNCTION void | tzset (void)

## Defines

#define | ACE_EXPORT_MACRO ACE_Export
#define | ACE_HRTIME_CONVERSION(VAL) ACE_U64_TO_U32(VAL)
#define | ACE_HRTIME_TO_U64(VAL) (VAL)
#define | ACE_GETHRTIME_NAME ACE_gethrtime
#define | ACE_INLINE inline

## Typedefs

typedef unsigned __int64 | ACE_QWORD
typedef unsigned __int64 | ACE_hrtime_t

## Enumerations

enum | ACE_HRTimer_Op { ACE_HRTIMER_START = 0x0, ACE_HRTIMER_INCR = 0x1, ACE_HRTIMER_STOP = 0x2, ACE_HRTIMER_GETTIME = 0xFFFF }

## Functions

long | ace_timezone ()
| Helper for the ACE_OS::timezone() function.
double | ace_difftime (time_t t1, time_t t0)
| Helper for the ACE_OS::difftime() function.
ACE_QWORD | ACE_MAKE_QWORD (DWORD lo, DWORD hi)
DWORD | ACE_LOW_DWORD (ACE_QWORD q)
DWORD | ACE_HIGH_DWORD (ACE_QWORD q)

## Variables

ACE_BEGIN_VERSIONED_NAMESPACE_DECL const ACE_UINT32 | ACE_U_ONE_SECOND_IN_MSECS = 1000U
const ACE_UINT32 | ACE_U_ONE_SECOND_IN_USECS = 1000000U
const ACE_UINT32 | ACE_U_ONE_SECOND_IN_NSECS = 1000000000U

## Detailed Description

Id
  OS_NS_time.h,v 1.17 2005/11/24 09:48:54 ossama Exp

Author:
  Douglas C. Schmidt <schmidt@cs.wustl.edu>

  Jesper S. M|ller<stophph@diku.dk>

  and a cast of thousands...

Originally in OS.h.

## Define Documentation

#define ACE_EXPORT_MACRO ACE_Export

#define ACE_GETHRTIME_NAME ACE_gethrtime

#define ACE_HRTIME_CONVERSION | ( | VAL |  | ) | ACE_U64_TO_U32(VAL)

#define ACE_HRTIME_TO_U64 | ( | VAL |  | ) | (VAL)

#define ACE_INLINE inline

## Typedef Documentation

typedef unsigned __int64 ACE_hrtime_t

typedef unsigned __int64 ACE_QWORD

## Enumeration Type Documentation

enum ACE_HRTimer_Op

Enumeration values:

  ACE_HRTIMER_START |
  ACE_HRTIMER_INCR |
  ACE_HRTIMER_STOP |
  ACE_HRTIMER_GETTIME |

## Function Documentation

double ace_difftime | ( | time_t | t1,
|  | time_t | t0
| ) | `[inline]`

| Helper for the ACE_OS::difftime() function. We moved the difftime code that used to be in ACE_OS::difftime() here because on some platforms "difftime" is a macro. Because of this, the name ACE_OS::difftime will cause errors. So in order to use the macro as it is defined but also keep the name ACE_OS::difftime, we use difftime first here in this inline function, and then undefine it.

DWORD ACE_HIGH_DWORD | ( | ACE_QWORD | q | ) | `[inline]`

DWORD ACE_LOW_DWORD | ( | ACE_QWORD | q | ) | `[inline]`

ACE_QWORD ACE_MAKE_QWORD | ( | DWORD | lo,
|  | DWORD | hi
| ) | `[inline]`

long ace_timezone | ( |  | ) | `[inline]`

| Helper for the ACE_OS::timezone() function. We put all the timezone stuff that used to be in ACE_OS::timezone() here because on some platforms "timezone" is a macro. Because of this, the name ACE_OS::timezone will cause errors. So in order to use the macro as it is defined but also keep the name ACE_OS::timezone, we use timezone first here in this inline function, and then undefine timezone.

ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE char * ACE_OS::asctime | ( | const struct tm * | tm | ) |

ACE_INLINE char * ACE_OS::asctime_r | ( | const struct tm * | tm,
|  | char * | buf,
|  | int | buflen
| ) |

ACE_INLINE int ACE_OS::clock_gettime | ( | clockid_t | ,
|  | struct timespec * |
| ) |

ACE_INLINE int ACE_OS::clock_settime | ( | clockid_t | ,
|  | const struct timespec * |
| ) |

ACE_INLINE ACE_TCHAR * ACE_OS::ctime | ( | const time_t * | t | ) |

ACE_INLINE ACE_TCHAR * ACE_OS::ctime_r | ( | const time_t * | clock,
|  | ACE_TCHAR * | buf,
|  | int | buflen
| ) |

ACE_INLINE double ACE_OS::difftime | ( | time_t | t1,
|  | time_t | t0
| ) |

ACE_NAMESPACE_INLINE_FUNCTION ACE_hrtime_t gethrtime | ( | const | ACE_HRTimer_Op = `ACE_HRTIMER_GETTIME` | ) |

ACE_INLINE struct tm * ACE_OS::gmtime | ( | const time_t * | clock | ) |

ACE_INLINE struct tm * ACE_OS::gmtime_r | ( | const time_t * | clock,
|  | struct tm * | res
| ) |

ACE_INLINE struct tm * ACE_OS::localtime | ( | const time_t * | clock | ) |

ACE_BEGIN_VERSIONED_NAMESPACE_DECL struct tm * ACE_OS::localtime_r | ( | const time_t * | clock,
|  | struct tm * | res
| ) |

time_t ACE_OS::mktime | ( | struct tm * | timeptr | ) |

ACE_INLINE int ACE_OS::nanosleep | ( | const struct timespec * | requested,
|  | struct timespec * | remaining = `0`
| ) |

ACE_INLINE size_t ACE_OS::strftime | ( | char * | s,
|  | size_t | maxsize,
|  | const char * | format,
|  | const struct tm * | timeptr
| ) |

char * ACE_OS::strptime | ( | char * | buf,
|  | const char * | format,
|  | struct tm * | tm
| ) |

ACE_INLINE time_t ACE_OS::time | ( | time_t * | tloc = `0` | ) |

ACE_INLINE long ACE_OS::timezone | ( | void |  | ) |

ACE_INLINE void ACE_OS::tzset | ( | void |  | ) |

## Variable Documentation

ACE_BEGIN_VERSIONED_NAMESPACE_DECL const ACE_UINT32 ACE_U_ONE_SECOND_IN_MSECS = 1000U`[static]`

const ACE_UINT32 ACE_U_ONE_SECOND_IN_NSECS = 1000000000U`[static]`

const ACE_UINT32 ACE_U_ONE_SECOND_IN_USECS = 1000000U`[static]`