mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-25 18:58:56 -06:00
libpgf: the time measurement in pgf-translate should be made after pgf_parse_result for more accurate timing
This commit is contained in:
@@ -129,14 +129,14 @@ int main(int argc, char* argv[]) {
|
|||||||
tok = strtok(NULL, " \n");
|
tok = strtok(NULL, " \n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Now begin enumerating the resulting syntax trees
|
||||||
|
GuEnum* result = pgf_parse_result(parse, ppool);
|
||||||
|
|
||||||
clock_t end = clock();
|
clock_t end = clock();
|
||||||
|
|
||||||
double cpu_time_used = ((double) (end - start)) / CLOCKS_PER_SEC;
|
double cpu_time_used = ((double) (end - start)) / CLOCKS_PER_SEC;
|
||||||
printf("%.2f sec\n", cpu_time_used);
|
printf("%.2f sec\n", cpu_time_used);
|
||||||
|
|
||||||
// Now begin enumerating the resulting syntax trees
|
|
||||||
GuEnum* result = pgf_parse_result(parse, ppool);
|
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
PgfExpr expr = gu_next(result, PgfExpr, ppool);
|
PgfExpr expr = gu_next(result, PgfExpr, ppool);
|
||||||
// The enumerator will return a null variant at the
|
// The enumerator will return a null variant at the
|
||||||
|
|||||||
Reference in New Issue
Block a user