summaryrefslogtreecommitdiff
path: root/modules/gdnative/nativescript/nativescript.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-08-22 22:27:42 +0200
committerGitHub <noreply@github.com>2018-08-22 22:27:42 +0200
commitd9cad85f43a1ca319c391b53a631e92a99d252ff (patch)
tree9bff4c8798742e72fddabf6190b306aea2936cbc /modules/gdnative/nativescript/nativescript.h
parenta752e2f4a370d82b5769f784bc030af4a61369c1 (diff)
parenta323b7a1ba0082967df22411519c713348514b38 (diff)
Merge pull request #21229 from marcelofg55/ns_profiling
Implemented profiling functions for NativeScript
Diffstat (limited to 'modules/gdnative/nativescript/nativescript.h')
-rw-r--r--modules/gdnative/nativescript/nativescript.h18
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 {