diff --git a/cli_classic.c b/cli_classic.c index a9f9dc107..0f303c080 100644 --- a/cli_classic.c +++ b/cli_classic.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "flash.h" #include "flashchips.h" #include "fmap.h" @@ -1049,6 +1050,7 @@ int main(int argc, char *argv[]) int ret = 0; int all_matched_count = 0; const char **all_matched_names = NULL; + time_t time_start, time_end; struct cli_options options = { 0 }; static const char optstring[] = "r::Rw::v::nNVEfc:l:i:p:Lzho:x"; @@ -1196,6 +1198,8 @@ int main(int argc, char *argv[]) if (flashrom_init(1)) exit(1); + time(&time_start); + if (programmer_init(options.prog, options.pparam)) { msg_perr("Error: Programmer initialization failed.\n"); ret = 1; @@ -1536,6 +1540,11 @@ out: flashrom_data_free(all_matched_names); free_options(&options); + + time(&time_end); + msg_gdbg("Runtime from programmer init to shutdown: %dmin%2dsec\n", + (int)(difftime(time_end, time_start) / 60), (int)(difftime(time_end, time_start)) % 60); + ret |= close_logfile(); return ret; }