Clipping donegit status! loading and showing sponza mini
This commit is contained in:
22
profile.cpp
Normal file
22
profile.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
enum ProfileScopeName {
|
||||
ProfileScopeName_draw_triangle,
|
||||
ProfileScopeName_Count,
|
||||
};
|
||||
|
||||
struct ProfileScope {
|
||||
F64 samples[5096];
|
||||
I64 i;
|
||||
};
|
||||
|
||||
GLOBAL ProfileScope profile_scopes[ProfileScopeName_Count];
|
||||
|
||||
#define PROFILE_BEGIN(name) do { \
|
||||
ProfileScope *__profile_scope = profile_scopes + ProfileScopeName_##name; \
|
||||
__profile_scope->samples[__profile_scope->i] = os_time(); \
|
||||
} while (0)
|
||||
|
||||
#define PROFILE_END(name) do { \
|
||||
ProfileScope *_profile_scope = profile_scopes + ProfileScopeName_##name; \
|
||||
_profile_scope->samples[_profile_scope->i] = os_time() - _profile_scope->samples[_profile_scope->i]; \
|
||||
_profile_scope->i = (_profile_scope->i + 1) % 5096; \
|
||||
}while (0)
|
||||
Reference in New Issue
Block a user