1 /*
2  * Copyright (c) 2018 Nordic Semiconductor ASA
3  * Copyright (c) 2016 Intel Corporation
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
8 #include "kernel_shell.h"
9 
10 #include <zephyr/kernel.h>
11 
cmd_kernel_sleep(const struct shell * sh,size_t argc,char ** argv)12 static int cmd_kernel_sleep(const struct shell *sh, size_t argc, char **argv)
13 {
14 	ARG_UNUSED(argc);
15 
16 	uint32_t ms;
17 	int err = 0;
18 
19 	ms = shell_strtoul(argv[1], 10, &err);
20 
21 	if (!err) {
22 		k_msleep(ms);
23 	} else {
24 		shell_error(sh, "Unable to parse input (err %d)", err);
25 		return err;
26 	}
27 
28 	return 0;
29 }
30 
31 KERNEL_CMD_ARG_ADD(sleep, NULL, "ms", cmd_kernel_sleep, 2, 0);
32