* run_command() function. Since this function has ARM-dependent timer
* codes, we cannot merge it with the run_command() for now.
*/
-static int run_command_and_time_it(int flag, int argc, char * const argv[],
+static int run_command_and_time_it(int flag, int argc, char *const argv[],
ulong *cycles)
{
cmd_tbl_t *cmdtp = find_cmd(argv[0]);
int retval = 0;
+ unsigned long start;
if (!cmdtp) {
printf("%s: command not found\n", argv[0]);
if (argc > cmdtp->maxargs)
return CMD_RET_USAGE;
- /*
- * TODO(clchiou): get_timer_masked() is only defined in certain ARM
- * boards. We could use the new timer API that Graeme is proposing
- * so that this piece of code would be arch-independent.
- */
- *cycles = get_timer_masked();
+ start = get_timer(0);
retval = cmdtp->cmd(cmdtp, flag, argc, argv);
- *cycles = get_timer_masked() - *cycles;
+ *cycles = get_timer(start);
return retval;
}