mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
1999-03-07 Mark Kettenis <kettenis@gnu.org>
* sysdeps/unix/bsd/clock.c (timeval_to_clock_t): Use CLOCKS_PER_SEC instead of CLK_TCK.
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1991, 1997, 1998 Free Software Foundation, Inc.
|
/* Copyright (C) 1991, 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -17,8 +17,8 @@
|
|||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#include <time.h>
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
__inline
|
__inline
|
||||||
@ -26,8 +26,8 @@ __inline
|
|||||||
static clock_t
|
static clock_t
|
||||||
timeval_to_clock_t (const struct timeval *tv)
|
timeval_to_clock_t (const struct timeval *tv)
|
||||||
{
|
{
|
||||||
return (clock_t) ((tv->tv_sec * CLK_TCK) +
|
return (clock_t) ((tv->tv_sec * CLOCKS_PER_SEC) +
|
||||||
(tv->tv_usec * CLK_TCK / 1000000));
|
(tv->tv_usec * CLOCKS_PER_SEC / 1000000));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the time used by the program so far (user time + system time). */
|
/* Return the time used by the program so far (user time + system time). */
|
||||||
|
Reference in New Issue
Block a user