src/timer.c
/************************************************************************/
/*									*/
/*			     N _ O P _ r c l k				*/
/*									*/
/*	Get the current time in UNIX format, convert it to micro-	*/
/*	seconds in ALTO format, and store the low 32 bits into		*/
/*	the FIXP cell passed in to us on the top of stack.		*/
/*									*/
/************************************************************************/
N _ O P _ r c l k

Get the current time in UNIX format, convert it to micro
seconds in ALTO format, and store the low 32 bits into
the FIXP cell passed in to us on the top of stack.
N _ O P _ r c l k Get the current time in UNIX format convert it to micro seconds in ALTO format and store the low 32 bits into the FIXP cell passed in to us on the top of stack .
LispPTR N_OP_rclk(LispPTR tos)
{
  unsigned int usec;
#ifdef DOS
  struct dostime_t dtm;
#endif 
#ifdef DOS
  _dos_gettime(&dtm);
  usec = (time(0) * 1000000) + (10000 * dtm.hsecond);
#else
  struct timeval timev;
  gettimeofday(&timev, NULL);
  usec = (timev.tv_sec * 1000000UL) + timev.tv_usec;
#endif 
  *((unsigned int *)(Addr68k_from_LADDR(tos))) = usec;
  return (tos);
}
LispPTR N_OP_rclk ( LispPTR tos ) { unsigned int usec ; #ifdef DOS struct dostime_t dtm ; #endif #ifdef DOS _dos_gettime ( & dtm ) ; usec = ( time ( 0 ) * 1000000 ) + ( 10000 * dtm . hsecond ) ; #else struct timeval timev ; gettimeofday ( & timev , NULL ) ; usec = ( timev . tv_sec * 1000000UL ) + timev . tv_usec ; #endif * ( ( unsigned int * ) ( Addr68k_from_LADDR ( tos ) ) ) = usec ; return ( tos ) ; }
N _ O P _ r c l k
N _ O P _ r c l k
/* DOS */ /* DOS */