Skip to content

Commit d3d8c81

Browse files
authored
Merge pull request #62 from danielzgtg/feat/timings
cli: Add tts_timing_printer
2 parents ec35075 + 169c034 commit d3d8c81

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

examples/cli/cli.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,21 @@
66
#include "write_file.h"
77
#include <thread>
88

9+
class tts_timing_printer {
10+
const int64_t start_us{[] {
11+
ggml_time_init();
12+
return ggml_time_us();
13+
}()};
14+
public:
15+
~tts_timing_printer() {
16+
const int64_t end_us{ggml_time_us()};
17+
// Just a simple "total time" for now before adding "load" / "prompt eval" / "eval" from llama_print_timings
18+
printf("total time = %.2f ms\n", (end_us - start_us) / 1000.0f);
19+
}
20+
};
21+
922
int main(int argc, const char ** argv) {
23+
const tts_timing_printer _{};
1024
float default_temperature = 1.0f;
1125
int default_n_threads = std::max((int)std::thread::hardware_concurrency(), 1);
1226
int default_top_k = 50;
@@ -34,7 +48,7 @@ int main(int argc, const char ** argv) {
3448
args.parse(argc, argv);
3549
if (args.for_help) {
3650
args.help();
37-
return 0;
51+
exit(0);
3852
}
3953
args.validate();
4054

0 commit comments

Comments
 (0)