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