2006-01-06 20:59:09 +00:00
|
|
|
/* vi: set sw=4 ts=4: */
|
|
|
|
/*
|
|
|
|
* Busybox utility routines.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2005 by Tito Ragusa <tito-wolit@tiscali.it>
|
|
|
|
*
|
|
|
|
* Licensed under the GPL v2, see the file LICENSE in this tarball.
|
|
|
|
*/
|
|
|
|
|
2006-04-03 16:39:31 +00:00
|
|
|
#include "libbb.h"
|
2006-01-06 20:59:09 +00:00
|
|
|
|
2008-06-27 02:52:20 +00:00
|
|
|
void FAST_FUNC bb_do_delay(int seconds)
|
2006-01-06 20:59:09 +00:00
|
|
|
{
|
|
|
|
time_t start, now;
|
|
|
|
|
2009-10-27 08:54:34 +00:00
|
|
|
start = time(NULL);
|
|
|
|
do {
|
2006-01-06 20:59:09 +00:00
|
|
|
sleep(seconds);
|
2009-10-27 08:54:34 +00:00
|
|
|
now = time(NULL);
|
|
|
|
} while ((now - start) < seconds);
|
2006-01-06 20:59:09 +00:00
|
|
|
}
|