Main Page | Class List | Directories | File List | Class Members | File Members

pike_rusage.h

Go to the documentation of this file.
00001 /*
00002 || This file is part of Pike. For copyright information see COPYRIGHT.
00003 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
00004 || for more information.
00005 || $Id: pike_rusage.h,v 1.17 2004/05/19 20:57:04 grubba Exp $
00006 */
00007 
00008 #ifndef PIKE_RUSAGE_H
00009 #define PIKE_RUSAGE_H
00010 
00011 #ifdef HAVE_TIMES
00012 extern long pike_clk_tck;
00013 #define init_rusage() (pike_clk_tck = sysconf (_SC_CLK_TCK))
00014 #else
00015 #define init_rusage()
00016 #endif
00017 
00018 /* Prototypes begin here */
00019 typedef long pike_rusage_t[29];
00020 int pike_get_rusage(pike_rusage_t rusage_values);
00021 long *low_rusage(void);
00022 
00023 /* get_cpu_time returns the consumed cpu time (both in kernel and user
00024  * space, if applicable), or -1 if it couldn't be read. Note that
00025  * many systems have fairly poor resolution, e.g. on Linux x86 it's
00026  * only 0.01 second. gettimeofday can therefore be a better choice to
00027  * measure small time intervals. */
00028 #ifdef INT64
00029 /* The time is returned in nanoseconds. */
00030 typedef INT64 cpu_time_t;
00031 #define LONG_CPU_TIME
00032 #define CPU_TIME_TICKS /* per second */ ((cpu_time_t) 1000000000)
00033 #define CPU_TIME_UNIT "ns"
00034 #define PRINT_CPU_TIME PRINTINT64 "d"
00035 #else
00036 /* The time is returned in milliseconds. (Note that the value will
00037  * wrap after about 49 days.) */
00038 typedef unsigned long cpu_time_t;
00039 #define CPU_TIME_TICKS /* per second */ ((cpu_time_t) 1000)
00040 #define CPU_TIME_UNIT "ms"
00041 #define PRINT_CPU_TIME "lu"
00042 #endif
00043 cpu_time_t get_cpu_time (void);
00044 cpu_time_t get_real_time(void);
00045 
00046 INT32 internal_rusage(void);    /* For compatibility. */
00047 
00048 #if defined(PIKE_DEBUG) || defined(INTERNAL_PROFILING)
00049 void debug_print_rusage(FILE *out);
00050 #endif
00051 /* Prototypes end here */
00052 
00053 #endif /* !PIKE_RUSAGE_H */

Generated on Fri Jul 22 23:44:26 2005 for Pike by  doxygen 1.3.9.1