/* -----------------------------------------------------------------------------
- * $Id: Itimer.c,v 1.36 2003/12/22 16:27:10 simonmar Exp $
*
* (c) The GHC Team, 1995-1999
*
startTicker(nat ms, TickProc handle_tick)
{
# ifndef HAVE_SETITIMER
- /* fprintf(stderr, "No virtual timer on this system\n"); */
+ /* debugBelch("No virtual timer on this system\n"); */
return -1;
# else
struct itimerval it;
stopTicker()
{
# ifndef HAVE_SETITIMER
- /* fprintf(stderr, "No virtual timer on this system\n"); */
+ /* debugBelch("No virtual timer on this system\n"); */
return -1;
# else
struct itimerval it;
/* gettimeofday() takes around 1us on our 500MHz PIII. Since we're
* only calling it 50 times/s, it shouldn't have any great impact.
*/
-unsigned int
+lnat
getourtimeofday(void)
{
struct timeval tv;
gettimeofday(&tv, (struct timezone *) NULL);
- return (tv.tv_sec * TICK_FREQUENCY +
- tv.tv_usec * TICK_FREQUENCY / 1000000);
+ // cast to lnat because nat may be 64 bit when int is only 32 bit
+ return ((lnat)tv.tv_sec * TICK_FREQUENCY +
+ (lnat)tv.tv_usec * TICK_FREQUENCY / 1000000);
}
-