{"id":1689,"date":"2025-07-30T14:31:10","date_gmt":"2025-07-30T20:31:10","guid":{"rendered":"https:\/\/www.great-white-software.com\/blog\/?p=1689"},"modified":"2025-07-30T14:31:10","modified_gmt":"2025-07-30T20:31:10","slug":"weird-little-tidbit","status":"publish","type":"post","link":"https:\/\/www.great-white-software.com\/blog\/2025\/07\/30\/weird-little-tidbit\/","title":{"rendered":"Weird little tidbit"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Got asked an interesting question<br>Can you know, in code, if profiling is or was enabled when the app was built ?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">At first I couldn&#8217;t think of a way so I said &#8220;off the top of my head no&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But a bit more poking about and I came up with<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Public Function isprofiling() As boolean\n  For i As Integer = 0 To runtime.ObjectCount - 1\n    \n    Dim s As String = runtime.ObjectClass(i)\n    \n    If s = \"_Profiler.Profile\" Then \n      Return True\n    End If\n    \n  Next\n  \n  return false\n  \nEnd Function<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And now you can actually tell if profiling was on or not when the app was built and so is available to be enabled or not with the start profiling \/ stop profiling commands<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Got asked an interesting questionCan you know, in code, if profiling is or was enabled when the app was built ? At first I couldn&#8217;t think of a way so I said &#8220;off the top of my head no&#8221; But a bit more poking about and I came up with And now you can actually &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.great-white-software.com\/blog\/2025\/07\/30\/weird-little-tidbit\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Weird little tidbit&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-1689","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/1689","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/comments?post=1689"}],"version-history":[{"count":1,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/1689\/revisions"}],"predecessor-version":[{"id":1690,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/1689\/revisions\/1690"}],"wp:attachment":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/media?parent=1689"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/categories?post=1689"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/tags?post=1689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}