CMS 3D CMS Logo

TimeInfo.h

Go to the documentation of this file.
00001 #ifndef CLASSLIB_SYSAPI_TIME_INFO_H
00002 # define CLASSLIB_SYSAPI_TIME_INFO_H
00003 
00004 //<<<<<< INCLUDES                                                       >>>>>>
00005 
00006 # include "classlib/sysapi/system.h"
00007 # include <cerrno>
00008 
00009 // FIXME: use the autoconf logic to include time.h and sys/time.h
00010 # ifdef _WIN32
00011 #  include <windows.h>
00012 #  include <time.h>
00013 # else
00014 #  include <unistd.h>
00015 #  include <fcntl.h>
00016 #  if TIME_WITH_SYS_TIME
00017 #   include <sys/time.h>
00018 #   include <time.h>
00019 #  else
00020 #   if HAVE_SYS_TIME_H
00021 #    include <sys/time.h>
00022 #   else
00023 #    include <time.h>
00024 #   endif
00025 #  endif
00026 #  if HAVE_SYS_TIMES_H
00027 #   include <sys/times.h>
00028 #  endif
00029 #  if HAVE_SYS_SYSCTL_H
00030 #   include <sys/sysctl.h>
00031 #  endif
00032 #  if HAVE_SYS_PROCESSOR_H
00033 #   include <sys/processor.h>
00034 #  endif
00035 #  if HAVE_SYS_RESOURCE_H
00036 #   include <sys/resource.h>
00037 #  endif
00038 #  if HAVE_PMAPI_H
00039 #   include <pmapi.h>
00040 #  endif
00041 #  if HAVE_INVENT_H
00042 #   include <invent.h>
00043 #  endif
00044 #  if HAVE_MACH_MACH_TIME_H
00045 #   include <mach/mach_time.h>
00046 #  endif
00047 //   #if HAVE_MACHINE_INLINE_H
00048 //   # include <machine/inline.h>
00049 //   #endif
00050 #  if HAVE_SYS_PSTAT_H
00051 #   define _PSTAT64
00052 #   include <sys/param.h>
00053 #   include <sys/pstat.h>
00054 #  endif
00055 #  if HAVE_PROCFS_H
00056 #   include <procfs.h>
00057 #  endif
00058 # endif
00059 # include <limits.h>
00060 # include <stdio.h>
00061 # include <string.h>
00062 # include <stdlib.h>
00063 
00064 //<<<<<< PUBLIC DEFINES                                                 >>>>>>
00065 
00066 // A gross hack for linux which lies that CLK_TCK is 1000000 when the
00067 // values are really 100.
00068 # ifdef __linux
00069 #  undef CLK_TCK
00070 #  define CLK_TCK 100
00071 # endif
00072 
00073 // Define some helper states to simplify the logic
00074 
00075 #if HAVE_READ_REAL_TIME || defined CPU_REAL_CYCLES_ASM || HAVE_MACH_MACH_TIME_H || defined _WIN32
00076 # define HAVE_CPU_REAL_CYCLE_COUNTER 1
00077 #endif
00078 
00079 #if (HAVE_GETHRTIME                                     \
00080      || (HAVE_CLOCK_GETTIME && HAVE_CLOCK_SGI_CYCLE)    \
00081      || HAVE_CPU_REAL_CYCLE_COUNTER)
00082 # define HAVE_CPU_REAL_TIME_COUNTER 1
00083 #endif
00084 
00085 #if defined CPU_VIRTUAL_CYCLES_ASM
00086 # define HAVE_CPU_VIRTUAL_CYCLE_COUNTER 1
00087 #endif
00088 
00089 //<<<<<< PUBLIC CONSTANTS                                               >>>>>>
00090 //<<<<<< PUBLIC TYPES                                                   >>>>>>
00091 //<<<<<< PUBLIC VARIABLES                                               >>>>>>
00092 //<<<<<< PUBLIC FUNCTIONS                                               >>>>>>
00093 //<<<<<< CLASS DECLARATIONS                                             >>>>>>
00094 //<<<<<< INLINE PUBLIC FUNCTIONS                                        >>>>>>
00095 //<<<<<< INLINE MEMBER FUNCTIONS                                        >>>>>>
00096 
00097 #endif // CLASSLIB_SYSAPI_TIME_INFO_H

Generated on Tue Jun 9 17:38:53 2009 for CMSSW by  doxygen 1.5.4