1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 /***************************************************************************
4 * Copyright (C) 2010 by Øyvind Harboe *
5 ***************************************************************************/
7 /* this file contains various functionality useful to standalone systems */
14 #include "time_support.h"
16 static int jim_util_ms(Jim_Interp *interp,
18 Jim_Obj * const *argv)
21 Jim_WrongNumArgs(interp, 1, argv, "ls ?dir?");
25 /* Cast from 64 to 32 bit int works for 2's-compliment
26 * when calculating differences*/
27 Jim_SetResult(interp, Jim_NewIntObj(interp, (int)timeval_ms()));
32 static const struct command_registration util_command_handlers[] = {
37 .jim_handler = jim_util_ms,
39 "Returns ever increasing milliseconds. Used to calculate differences in time.",
42 COMMAND_REGISTRATION_DONE
45 int util_init(struct command_context *cmd_ctx)
47 return register_commands(cmd_ctx, NULL, util_command_handlers);