Rob Landley | 84cb767 | 2006-01-06 20:59:09 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* |
| 3 | * Busybox utility routines. |
| 4 | * |
| 5 | * Copyright (C) 2005 by Tito Ragusa <tito-wolit@tiscali.it> |
| 6 | * |
Denys Vlasenko | 0ef64bd | 2010-08-16 20:14:46 +0200 | [diff] [blame] | 7 | * Licensed under GPLv2, see file LICENSE in this source tree. |
Rob Landley | 84cb767 | 2006-01-06 20:59:09 +0000 | [diff] [blame] | 8 | */ |
Bernhard Reutner-Fischer | 421d9e5 | 2006-04-03 16:39:31 +0000 | [diff] [blame] | 9 | #include "libbb.h" |
Rob Landley | 84cb767 | 2006-01-06 20:59:09 +0000 | [diff] [blame] | 10 | |
Denis Vlasenko | defc1ea | 2008-06-27 02:52:20 +0000 | [diff] [blame] | 11 | void FAST_FUNC bb_do_delay(int seconds) |
Rob Landley | 84cb767 | 2006-01-06 20:59:09 +0000 | [diff] [blame] | 12 | { |
| 13 | time_t start, now; |
| 14 | |
Denys Vlasenko | 12450db | 2009-10-27 09:54:34 +0100 | [diff] [blame] | 15 | start = time(NULL); |
| 16 | do { |
Rob Landley | 84cb767 | 2006-01-06 20:59:09 +0000 | [diff] [blame] | 17 | sleep(seconds); |
Denys Vlasenko | 12450db | 2009-10-27 09:54:34 +0100 | [diff] [blame] | 18 | now = time(NULL); |
| 19 | } while ((now - start) < seconds); |
Rob Landley | 84cb767 | 2006-01-06 20:59:09 +0000 | [diff] [blame] | 20 | } |