Add spall profiler and stop generating layout every frame
This commit is contained in:
@@ -204,3 +204,25 @@ FileIter IterateFiles(Allocator alo, String path) {
|
||||
Advance(&it);
|
||||
return it;
|
||||
}
|
||||
|
||||
#if _WIN32
|
||||
#include <Windows.h>
|
||||
double get_time_in_micros(void) {
|
||||
static double invfreq;
|
||||
if (!invfreq) {
|
||||
LARGE_INTEGER frequency;
|
||||
QueryPerformanceFrequency(&frequency);
|
||||
invfreq = 1000000.0 / frequency.QuadPart;
|
||||
}
|
||||
LARGE_INTEGER counter;
|
||||
QueryPerformanceCounter(&counter);
|
||||
return counter.QuadPart * invfreq;
|
||||
}
|
||||
#else
|
||||
#include <unistd.h>
|
||||
double get_time_in_micros(void) {
|
||||
struct timespec spec;
|
||||
clock_gettime(CLOCK_MONOTONIC, &spec);
|
||||
return (((double)spec.tv_sec) * 1000000) + (((double)spec.tv_nsec) / 1000);
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user