Kotlin: Record compilation and extraction times

This commit is contained in:
Ian Lynagh
2021-09-13 14:31:47 +01:00
parent 396b5882ef
commit 598a2f8cb0
3 changed files with 26 additions and 1 deletions

View File

@@ -116,6 +116,17 @@ diagnostic_for(
int file_number_diagnostic_number : int ref
);
/**
* The `cpu_seconds` and `elapsed_seconds` are the CPU time and elapsed
* time (respectively) that the original compilation (not the extraction)
* took for compiler invocation `id`.
*/
compilation_compiler_times(
unique int id : @compilation ref,
float cpu_seconds : float ref,
float elapsed_seconds : float ref
);
/**
* If extraction was successful, then `cpu_seconds` and
* `elapsed_seconds` are the CPU time and elapsed time (respectively)

View File

@@ -70,6 +70,18 @@ class Compilation extends @compilation {
*/
string getArgument(int i) { compilation_args(this, i, result) }
/**
* Gets the total amount of CPU time spent processing all the files in the
* compiler.
*/
float getCompilerCpuSeconds() { compilation_compiler_times(this, result, _) }
/**
* Gets the total amount of elapsed time while processing all the files in
* the compiler.
*/
float getCompilerElapsedSeconds() { compilation_compiler_times(this, _, result) }
/**
* Gets the total amount of CPU time spent processing all the files in the
* front-end and extractor.