$starttime
is undefined in your footer, so you’re subtracting nothing from endtime. declare global $starttime
first and it’ll work.
that said, it won’t be a very accurate indicator of rendering time, since most of the work WordPress does happens before you ever reach the template and start your timer. There’s already a built-in timer that starts when WP is first loaded, you can print the output with the timer_stop function.
Related Posts:
- Sending the reset password link programatically
- Getting only direct child pages in WordPress with get_pages
- Disable Attachment Pages Completely
- How to add a .php file to WordPress
- How to Remove all Instances of edit_post_link
- Any guides on creating custom admin pages?
- Nginx FastCGI_Cache Vs PHP Caching
- Multiple is_page() in page.php
- How to check if feed URL was requested?
- Create WordPress pages with PHP
- Conditionally loading JavaScript based on the Advanced Custom Fields in the post
- Is it possible to generate a page without create in the admin?
- How to change “Shipping Calculator “field label on Cart Page – woocommerce? [closed]
- WordPress admin never finishes saving page on site with large page count
- class=”parent” for wp_list_pages?
- PHP Script within wordpress theme
- add_rewrite_rule with bottom priority doesn’t handle the WordPress pages
- Listing all sub-pages?
- How to link to a custom .php page in my folder
- Get only the grandchildren, not the direct children of page/current page?
- Help with a custom page template – listing contents of childpages?
- Extremely slow pageload for long post when using the_content?
- Print number of post (in reverse)
- Performance issues with large website [closed]
- Passing the page ID to a login php script
- Why does running get_the_excerpt() when generating JSON file take 28 seconds vs. 599 milliseconds without it?
- How can the plugin directory path be returned into ?
- Add a Different CSS Class Into The Body Tag of Different WP Pages
- PHP 5.5, w3 Total Cache, and opcache [closed]
- Using get_bloginfo(‘template_directory’) or variable – performance issue
- Limit get_pages to only show 5 items
- Looking for most performant way to execute several similar WP queries within shortcodes
- It is a good idea to store values from the global $post if they are used multiple times?
- syntax issue on php 7.4
- How do I publish only one page to production after making changes on staging?
- Custom Template 404 for specific custom post type
- Can’t load WP function into external function
- Custom category code not showing all posts
- Insert a button on a page with random number generation
- Can’t get page content in WordPress
- Way to querry data (tags) from a wordpress database?
- Global variable $post returning incorrect object
- How can I load a PHP page without using a Template?
- Best practice for migration friendly images in posts/pages?
- Page Automatically Generated from Theme?
- How to add a php custom page to WordPress
- Sort query_posts for Parent Pages to menue order or the count?
- How to hide all child pages with post_query?
- WordPress Script stops suddenly
- My page.php shows the index.php
- Populate editor with some content of a page with a page template
- How can I add an area/option for a custom page description?
- Create Page To Count Comments For Each Post In WordPress Site
- get_the_title() gets printed out twice
- How do I find PHP file that contains content of my page?
- is there a benefit in using a constant over get_stylesheet_directory_uri?
- WordPress page content outside WordPress
- How to tell if a page has subpages for Custom Post Types
- loading a php file to a specific page id
- Getting page / post URL on publish and / or update
- Serve cookie free URLs in WordPress without using a CDN
- Use page-templates without creating theme
- Get current_post in reverse order with pagination
- (Xdebug Profiler) Why are there two cachegrind files generated for one page?
- How to associate dynamic PHP page for chosen WordPress tag?
- Newbie question. Login/Registration. New PHP page
- Adding my own custom template page but got white page
- Create page in templates for pages or the pages manager?
- Create a custom theme-specific page, invisible in the admin-panel?
- Perfmon performance counters on WAMP
- Replace content in WordPress Page after GET from php page
- List of child pages fetch next results at link click
- Execute php in pages
- Why isn’t my link attribute getting my css?
- How to map my php files as the files for pages
- How to use PHP code with wordpress page
- Show results for multiple page-types
- How to add feature image url in my template file and content as well?
- Display selected parts from selected pages on the frontpage?
- Adding Media button to only pages
- Trying to put a search page on site
- I want Page titles and excerpts to show up on home.php in certain order
- ACF: Echo page title when checkbox is checked
- Create a custom page URL
- How to refresh a template page on WordPress in 3 seconds – easiest method?
- Hide page title
- I can’t seem to get excerpts showing inside get_pages and don’t know why?
- WordPress article with 50 000 words loading slow – 100% cpu
- Forbid certain users to access a specific page
- How to return a Boolean for a page that is a subpage thru its name?
- How to handle parent and child pages?
- How do I remove blog entries from home page Twenty Eleven child theme?
- Create an if statement based on page_id
- PHP warning $post->ID is null
- hello can you advise how to fix the error?
- In WordPress how do you remove render-blocking CSS manually without a plugin?
- WordPress post-template null warnings
- Will php code slow down site?
- “Object-cache.php” disables wp_cron and even disables my entire site, and keeps reappearing by itself again after I delete it
- Custom theme on multisite has issues with standard loop output