/* This file is part of Lcrzo.
*/

int lcrzo_time_pause_sec(lcrzo_uint32 sec)
#if defined LCRZODEF_SYSTEM_Unix
{ 
  lcrzo_uint32 time_sleep_threshold3;

  lcrzo_er(lcrzo_global_get_time_sleep_3threshold(&time_sleep_threshold3));
  if (sec<time_sleep_threshold3/1000000)
  { /*utilise usleep*/
    usleep(sec*1000000);
  }
  else
  { /*utilise sleep*/
    sleep(sec);
  }

  errno=0; /*because Solaris sets errno to 4*/
  return(LCRZO_ERR_OK);
}
#elif defined LCRZODEF_SYSTEM_Windows
{ Sleep(sec*1000);
  return(LCRZO_ERR_OK);
}
#else
 #error "Unknown value for LCRZODEF_SYSTEM"
#endif

