mirror of
https://github.com/radareorg/radare2.git
synced 2025-03-02 19:26:43 +00:00
Implement floating point sleep command ##shell
This commit is contained in:
parent
13f99e358a
commit
8b23751180
@ -70,7 +70,7 @@ static const char *help_msg_sl[] = {
|
||||
"sl", "[+-][line]", "Seek to relative line",
|
||||
"slc", "", "Clear line cache",
|
||||
"sll", "", "Show total number of lines",
|
||||
"sleep", " [seconds]", "Sleep for an specific amount of time",
|
||||
"sleep", " [seconds]", "Sleep for an specific amount of time (support decimal values)",
|
||||
NULL
|
||||
};
|
||||
|
||||
@ -774,8 +774,15 @@ static int cmd_seek(void *data, const char *input) {
|
||||
{
|
||||
const char *arg = strchr (input, ' ');
|
||||
if (arg) {
|
||||
arg++;
|
||||
void *bed = r_cons_sleep_begin ();
|
||||
r_sys_sleep (atoi (arg + 1));
|
||||
if (strchr (arg, '.')) {
|
||||
double d = 0;
|
||||
sscanf (arg, "%lf", &d);
|
||||
r_sys_usleep ((int)(d * 1000000));
|
||||
} else {
|
||||
r_sys_sleep (atoi (arg));
|
||||
}
|
||||
r_cons_sleep_end (bed);
|
||||
} else {
|
||||
eprintf ("Usage: sleep [seconds]\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user