$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
- Any guides on creating custom admin pages?
- Nginx FastCGI_Cache Vs PHP Caching
- Multiple is_page() in page.php
- Create WordPress pages with PHP
- Is it possible to generate a page without create in the admin?
- WordPress admin never finishes saving page on site with large page count
- 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
- 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 ?
- PHP 5.5, w3 Total Cache, and opcache [closed]
- Using get_bloginfo(‘template_directory’) or variable – performance issue
- 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
- Can’t load WP function into external function
- 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?
- How to add a php custom page to WordPress
- WordPress Script stops suddenly
- 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
- Using the_excerpt() on a page
- Inject class in body when particular page template is used
- Use .php file as page instead of wordpress page & template file?
- Use WordPress function in php file
- Why am I getting a different filename? And how does WordPress load singular.php for both Page & Post? (Fresh WordPress installation)
- How to check if the current page is at a specified path in the URL?
- Show About and Contact Us page when they’re clicked in the top menu.
- Parsing Menu Items and Blog Posts
- How to use theme function in post/page?
- My php code is not being executed
- Apply class to every third list item? [duplicate]
- How to include custom code on a page that’s set to act as homepage?
- Can a page contain php code?
- Insert page content into another page with a changed variable
- How to echo every parent page title?
- How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]
- Retrieve Json data and create multiple pages with it
- How to add page numbering with php?
- Noindex subscriber author page
- Removing custom sort order from admin page listing
- PHP Output also in Child theme, but different
- $wpdb->get_results breaking page?
- How to Display a List of Child Pages For a Parent Page in WordPress
- List all anchor links on a page
- How do I add my PHP app to a WordPress page whilst keeping semantic URLs?
- Page not visible in ‘All pages’ after being added through PHP
- Cascading dropdown select search based on Parent Page & Child Page
- Edit and delete permissions pages and posts
- My worpress search page is showing no results
- A function to get the content of a page
- When I click for the redirect link it is showing the content of index.php instead of single_assignment_page.php
- How do you measure the PHP generation time of your WordPress pages?
- Display page content in different sections – based on page break block?
- Child and Parent Pages list of sub pages
- Huge time to first byte on live site
- 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
- Get current_post in reverse order with pagination
- (Xdebug Profiler) Why are there two cachegrind files generated for one page?
- 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 use PHP code with wordpress page
- Show results for multiple page-types
- Display selected parts from selected pages on the frontpage?
- 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?
- Create an if statement based on page_id
- WordPress post-template null warnings
- Custom theme on multisite has issues with standard loop output