aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorGiuliano Belinassi <giuliano.belinassi@usp.br>2021-06-09 10:48:16 -0300
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2021-06-09 10:48:16 -0300
commite59916214d3d02cf81ba07116bfc240dc8dc4f59 (patch)
tree0f1f4f769b96a855b91494056263cf5b1c121702 /gcc/toplev.c
parent450b006f3f98b27831e590433f2e7388d19a7a8c (diff)
downloadgcc-devel/icpp2021.zip
gcc-devel/icpp2021.tar.gz
gcc-devel/icpp2021.tar.bz2
Print statisticsdevel/icpp2021
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 9545088..314bdcd 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -456,9 +456,19 @@ compile_file (void)
timevar_start (TV_PHASE_PARSING);
timevar_push (TV_PARSE_GLOBAL);
+ struct timeval start, end;
+
+ gettimeofday(&start, NULL);
/* Parse entire file and generate initial debug information. */
lang_hooks.parse_file ();
+ gettimeofday(&end, NULL);
+
+ long seconds = (end.tv_sec - start.tv_sec);
+ long micros = ((seconds * 1000000) + end.tv_usec) - (start.tv_usec);
+
+ printf("Parsing: %ld.%06ld\n", seconds, micros);
+
timevar_pop (TV_PARSE_GLOBAL);
timevar_stop (TV_PHASE_PARSING);