MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / print_progress

Function print_progress

libCacheSim/utils/logging.c:26–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26void print_progress(double perc) {
27 static double last_perc = 0;
28 static time_t last_print_time = 0;
29 time_t cur_time = time(NULL);
30
31 if (perc - last_perc < 0.01 || cur_time - last_print_time < 60) {
32 last_perc = perc;
33 last_print_time = cur_time;
34 sleep(2);
35 return;
36 }
37 if (last_perc != 0) fprintf(stdout, "\033[A\033[2K\r");
38 fprintf(stdout, "%.2f%%...\n", perc);
39 last_perc = perc;
40 last_print_time = cur_time;
41}

Callers 3

simulate_at_multi_sizesFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected