More compile timers, euler3
This commit is contained in:
9
main.cpp
9
main.cpp
@@ -187,14 +187,19 @@ int main(int argument_count, char **arguments){
|
||||
Scratch scratch;
|
||||
String name = string_fmt(scratch, "%s.kl", arguments[1]);
|
||||
String c_filename = string_fmt(scratch, "%s.c", arguments[1]);
|
||||
String call = string_fmt(scratch, "clang.exe %s.c -g -o %s.exe && %s.exe", arguments[1], arguments[1], arguments[1]);
|
||||
String compiler_call = string_fmt(scratch, "clang.exe %s.c -g -o %s.exe", arguments[1], arguments[1]);
|
||||
String run_program = string_fmt(scratch, "%s.exe", arguments[1]);
|
||||
|
||||
String result = compile_file(name);
|
||||
FILE *f = fopen((const char *)c_filename.str, "w");
|
||||
assert(f);
|
||||
fprintf(f, "%.*s", (int)result.len, result.str);
|
||||
fclose(f);
|
||||
system((const char *)call.str);
|
||||
F64 begin = os_time();
|
||||
system((const char *)compiler_call.str);
|
||||
printf("\nCompile time: %f", os_time() - begin);
|
||||
|
||||
system((const char *)run_program.str);
|
||||
}
|
||||
else{
|
||||
String result = {};
|
||||
|
||||
Reference in New Issue
Block a user