2 * Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
4 * Copyright (c) 2009, Code Aurora Forum. All rights reserved.
7 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
9 * SPDX-License-Identifier: GPL-2.0+
13 * Get Timer overflows after 2^32 / CONFIG_SYS_HZ (32Khz) = 131072 sec
18 static int do_gettime(cmd_tbl_t *cmdtp, int flag, int argc,
21 unsigned long int val = get_timer(0);
24 printf("Timer val: %lu\n", val);
25 printf("Seconds : %lu\n", val / CONFIG_SYS_HZ);
26 printf("Remainder : %lu\n", val % CONFIG_SYS_HZ);
27 printf("sys_hz = %lu\n", (unsigned long int)CONFIG_SYS_HZ);
29 printf("CONFIG_SYS_HZ not defined");
30 printf("Timer Val %lu", val);
37 gettime, 1, 1, do_gettime,
38 "get timer val elapsed",
39 "get time elapsed from uboot start"