{"id":21840221,"url":"https://github.com/gocom/rah_runtime","last_synced_at":"2025-03-21T15:33:59.072Z","repository":{"id":2357799,"uuid":"3321160","full_name":"gocom/rah_runtime","owner":"gocom","description":"Diagnose Textpattern CMS' execution times","archived":false,"fork":false,"pushed_at":"2013-09-25T08:18:46.000Z","size":172,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-26T11:08:25.500Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://rahforum.biz/plugins/rah_runtime","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gocom.png","metadata":{"files":{"readme":"README.textile","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-02-01T02:23:39.000Z","updated_at":"2016-07-29T11:33:57.000Z","dependencies_parsed_at":"2022-08-26T16:00:20.042Z","dependency_job_id":null,"html_url":"https://github.com/gocom/rah_runtime","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocom%2Frah_runtime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocom%2Frah_runtime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocom%2Frah_runtime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocom%2Frah_runtime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gocom","download_url":"https://codeload.github.com/gocom/rah_runtime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244822886,"owners_count":20516185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-27T21:25:16.123Z","updated_at":"2025-03-21T15:33:59.034Z","avatar_url":"https://github.com/gocom.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"h1. rah_runtime\n\n\"Homepage\":http://rahforum.biz/plugins/rah_runtime | \"Packagist\":https://packagist.org/packages/rah/rah_runtime | \"Twitter\":https://twitter.com/gocom | \"GitHub\":https://github.com/gocom/rah_runtime | \"Support forum\":http://forum.textpattern.com/viewtopic.php?id=33914 | \"Donate\":http://rahforum.biz/donate/rah_runtime\n\nRah_runtime returns runtimes from point A to B in microseconds. The plugin can be used to diagnose runtimes of specific blocks of Textpattern's markup code.\n\nh2. Basics\n\nbc. \u003ctxp:rah_runtime format=\"1\"\u003e\n    ...contained statements...\n\u003c/txp:rah_runtime\u003e\n\nThe plugin introduces a new Textpattern tag, @\u003ctxp:rah_runtime /\u003e@. The tag calculates execution runtimes for Textpattern template markuThe runtimes can be printed to the page template and are added to a \"tag trace\":http://textpattern.net/wiki/index.php?title=Tag_trace.\n\nThe rah_runtime tag can be used both as a container and as a self-closing single tag. When the tag is used as a container, it calculates a runtime of the wrapped code. When used as a self-closing single tag, it calculates a runtime from the first tag instance to the second.\n\nh2. Attributes\n\n@\u003ctxp:rah_runtime/\u003e@ tag's attributes are as follows.\n\n*return*\nIf set to @1@, the tag outputs the runtime to the page template. If @0@ the runtime is only added and visible in the page's \"tag trace\":http://textpattern.net/wiki/index.php?title=Tag_trace when the site is in debugging mode. By default @return@ is @0@, and the runtimes are only added to the tag trace.\nExample: @return=\"1\"@ Default: @\"0\"@\n\n*format*\nReturn formatted version of the time. When used, resulting value (float) is presented as a fixed decimal number. By default the option is used (@1@).\nExample: @format=\"0\"@ Default: @\"1\"@\n\n*index*\nWith this attribute you can nest several tag pairs and count several independent runtimes. The @index@ attribute only applies when @\u003ctxp:rah_runtime /\u003e@ is used as a self-closing single tag.\nExample: @index=\"articles\"@ Default: @\"default\"@\n\n*persistent*\nIf set to @1@, the runtime is kept alive after returning. Normally the runtime pair is destroyed after using it, but with @persistent@ the initial runtime is kept and still usable. The attribute is useful if you want to calculate multiple runtimes from same single starting point. The @persistent@ attribute only applies when @\u003ctxp:rah_runtime /\u003e@ is used as a self-closing single tag.\nExample: @persistent=\"1\"@ Default: @\"0\"@\n\nh2. Examples\n\nh3. Using as a container\n\nAs a container, @rah_runtime@ calculates a runtime for the wrapped content.\n\nbc. \u003ctxp:rah_runtime\u003e\n    \u003ctxp:article_custom /\u003e\n\u003c/txp:rah_runtime\u003e\n\nThe above will return the contained statement's results, as it would normally without the rah_runtime, and the runtime of the contained statement is added to the page's \"tag trace\":http://textpattern.net/wiki/index.php?title=Tag_trace. The tag trace should display a line similar to this:\n\nbc. [rah_runtime (default): 0.000010013580322]\n\nh3. Using as a single tag\n\nWhen the rah_runtime tag is used as a single, self-closing tag, the runtime is calculated from a @\u003ctxp:rah_runtime/\u003e@ tag instance to the next. Essentially the runtime is for the markup and code between two @\u003ctxp:rah_runtime/\u003e@ tags.\n\nbc. \u003ctxp:rah_runtime /\u003e\n    \u003c!--\n        Some code here, for example:\n        \u003ctxp:article /\u003e\n    --\u003e\n\u003ctxp:rah_runtime /\u003e\n\nThe above will return all the markup normally, like there weren't any traces of rah_runtime, and the runtime is added to the page's tag trace as a line similar to this:\n\nbc. [rah_runtime (default): 0.000010013580322]\n\nh3. Returning runtimes to the page\n\nNormally the resulting runtimes are added to the \"tag trace\":http://textpattern.net/wiki/index.php?title=Tag_trace and are not visible in the normal page content. That is unless @return@ attribute is set to @1@.\n\nbc. \u003ctxp:rah_runtime /\u003e\nRuntime: \u003ctxp:rah_runtime return=\"1\" /\u003e\n\nThe runtime is added to the tag trace and the above will return:\n\nbc. Runtime: 0.00021401458032\n\nh3. Using multiple nested tag pairs\n\nThe rah_runtime tag's @index@ attribute can be used to nest and mix multiple @\u003ctxp:rah_runtime/\u003e@ tags and runtime pairs together. This will allow calculating simultaneous runtimes that overlap each others.\n\nbc. \u003ctxp:rah_runtime index=\"2\" /\u003e\n\u003ctxp:rah_runtime index=\"1\" /\u003e\nTime1: \u003ctxp:rah_runtime index=\"1\" return=\"1\" /\u003e\nTime2: \u003ctxp:rah_runtime index=\"2\" return=\"1\" /\u003e\n\nThe above will return two runtimes:\n\nbc. Time1: 0.000081\nTime2: 0.000184\n\nThe _time2_ contains the runtime of _time1_ and more.\n\nh3. Using persistent runtimes\n\nPersistent runtimes are useful when several runtimes are to be calculated from a same starting point.\n\nbc.. \u003c!--\n    Starting the runtime timer\n--\u003e\n\n\u003ctxp:rah_runtime persistent=\"1\" return=\"1\" /\u003e\n\n\n\u003c!--\n    Some code here, for example \u003ctxp:article /\u003e ...\n    then output a (first) runtime\n--\u003e\n\n\u003ctxp:rah_runtime persistent=\"1\" return=\"1\" /\u003e\n\n\u003c!--\n    Some more code here, for example\n    \u003ctxp:output_form form=\"myform\" /\u003e\n\n    Output runtime, calculated\n    from the same original starting point\n--\u003e\n\n\u003ctxp:rah_runtime persistent=\"1\" return=\"1\" /\u003e\n\n\u003c!--\n    Even some more code.\n    Finally, return the final runtime still calculated \n    from the same original starting point.\n--\u003e\n\n\u003ctxp:rah_runtime return=\"1\" /\u003e\n\np. Note that every one of the rah_runtime tags (except for the last) has @persistent@ attribute set to @1@. If the tag doesn't have it, then the runtime pair is destroyed after returning it. To finally destroy the runtime, set persistent to @\"0\"@ (zero) or leave it undefined.\n\nh2. Changelog\n\nh3. Version 0.5.0 - upcoming\n\n* Updated: Help file.\n\nh3. Version 0.4 - 2012/07/12\n\n* Added: @return@ attribute.\n* Added: Now the runtimes are added to the tag trace.\n* Added: Container tag mode support.\n* Changed: By default runtimes are only visible in a tag trace. Set @return@ attribute to @1@ (@return=\"1\"@) output runtimes to the page template.\n* Changed: Default @index@ to @default@. This is to avoid potential type juggling side-effects.\n\nh3. Version 0.3 - 2011/08/19\n\n* Added: a new attribute @persistent@. Disables destroying of used runtime pairs.\n* Changed: Now stores the runtimes in a static variable instead of a global.\n\nh3. Version 0.2 - 2010/06/18\n\n* Fixed: now returns as float (compatible with pre-PHP5). \"Thank you for reporting, Andreas\":http://forum.textpattern.com/viewtopic.php?pid=230410#p230410.\n\nh3. Version 0.1 - 2010/06/15\n\n* Initial release.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgocom%2Frah_runtime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgocom%2Frah_runtime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgocom%2Frah_runtime/lists"}