lib/gen/sleep.c
/*
** Provisional version of sleep()
**
** This version uses the raw number of clicks instead of
** the time of day. It yields control of the processor
** and loops until the specified number of seconds has passed
*/
Provisional version of sleep()
This version uses the raw number of clicks instead of
the time of day. It yields control of the processor
and loops until the specified number of seconds has passed
Provisional version of sleep () This version uses the raw number of clicks instead of the time of day . It yields control of the processor and loops until the specified number of seconds has passed
int sleep(int seconds) {
  if (seconds == 0) return 0;
  LONGWORD sticks;
  LONGWORD ticks;
  sticks = seconds * CLK_FREQ;
  ticks = utimeticks;
  while((utimeticks - ticks) < sticks) { 
    yield();
  }
  return(0);
}
int sleep ( int seconds ) { if ( seconds == 0 ) return 0 ; LONGWORD sticks ; LONGWORD ticks ; sticks = seconds * CLK_FREQ ; ticks = utimeticks ; while ( ( utimeticks - ticks ) < sticks ) { yield ( ) ; } return ( 0 ) ; }
Provisional version of sleep()
This version uses the raw number of clicks instead of
the time of day.
Provisional version of sleep () This version uses the raw number of clicks instead of the time of day .
// printf("Utimeticks: %l, ticks: %l\n", utimeticks, ticks);