X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=libiberty%2Fgetruntime.c;h=82f3d2e41858852e19ec3ab9215a55c66fa103ad;hb=3048a5c0bc47f77c8b3565a172b34e921e9ae87f;hp=4abfa83bf337b702d1d37397f0e6262e836c1634;hpb=1a163ca8de631d67b8f657e96e8d1ef6f0f5e113;p=pf3gnuchains%2Fgcc-fork.git diff --git a/libiberty/getruntime.c b/libiberty/getruntime.c index 4abfa83bf33..82f3d2e4185 100644 --- a/libiberty/getruntime.c +++ b/libiberty/getruntime.c @@ -1,5 +1,5 @@ /* Return time used so far, in microseconds. - Copyright (C) 1994, 1999 Free Software Foundation, Inc. + Copyright (C) 1994, 1999, 2002 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or @@ -14,14 +14,18 @@ Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" #include "ansidecl.h" #include "libiberty.h" +/* On some systems (such as WindISS), you must include + to get the definition of "time_t" before you include . */ +#include + /* There are several ways to get elapsed execution time; unfortunately no single way is available for all host systems, nor are there reliable ways to find out which way is correct for a given host. */ @@ -73,8 +77,20 @@ Boston, MA 02111-1307, USA. */ #endif #endif +/* + +@deftypefn Replacement long get_run_time (void) + +Returns the time used so far, in microseconds. If possible, this is +the time used by this process, else it is the elapsed time since the +process started. + +@end deftypefn + +*/ + long -get_run_time () +get_run_time (void) { #if defined (HAVE_GETRUSAGE) && defined (HAVE_SYS_RESOURCE_H) struct rusage rusage;