diff options
| author | Marcelo Fernandez <marcelofg55@gmail.com> | 2018-08-20 12:14:52 -0300 |
|---|---|---|
| committer | Marcelo Fernandez <marcelofg55@gmail.com> | 2018-08-22 15:40:41 -0300 |
| commit | a323b7a1ba0082967df22411519c713348514b38 (patch) | |
| tree | 65e6f8a538898e3e271e8726f166610fe62ec9ec /modules/gdnative/nativescript/nativescript.h | |
| parent | 75e540ce7259adbe1b1d4b22f2444078953da494 (diff) | |
| download | redot-engine-a323b7a1ba0082967df22411519c713348514b38.tar.gz | |
Implemented profiling functions for NativeScript
Diffstat (limited to 'modules/gdnative/nativescript/nativescript.h')
| -rw-r--r-- | modules/gdnative/nativescript/nativescript.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/gdnative/nativescript/nativescript.h b/modules/gdnative/nativescript/nativescript.h index c1f11646b0..6f18e2db27 100644 --- a/modules/gdnative/nativescript/nativescript.h +++ b/modules/gdnative/nativescript/nativescript.h @@ -254,6 +254,22 @@ private: Map<int, HashMap<StringName, const void *> > global_type_tags; + struct ProfileData { + StringName signature; + uint64_t call_count; + uint64_t self_time; + uint64_t total_time; + uint64_t frame_call_count; + uint64_t frame_self_time; + uint64_t frame_total_time; + uint64_t last_frame_call_count; + uint64_t last_frame_self_time; + uint64_t last_frame_total_time; + }; + + Map<StringName, ProfileData> profile_data; + bool profiling; + public: // These two maps must only be touched on the main thread Map<String, Map<StringName, NativeScriptDesc> > library_classes; @@ -343,6 +359,8 @@ public: virtual bool handles_global_class_type(const String &p_type) const; virtual String get_global_class_name(const String &p_path, String *r_base_type, String *r_icon_path) const; + + void profiling_add_data(StringName p_signature, uint64_t p_time); }; inline NativeScriptDesc *NativeScript::get_script_desc() const { |
