Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3391198
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:46:39+00:00 2026-05-18T03:46:39+00:00

Q: How do I calculate the total time it takes to render an MVC

  • 0

Q: How do I calculate the total time it takes to render an MVC page and display the time on the master page.

In Asp.net Web Form I created a Base page class like so:

public class PageBase : System.Web.UI.Page
{      
    private DateTime startTime = DateTime.Now;
    private TimeSpan renderTime;   
    public DateTime StartTime
    {
        set { startTime = value; }
        get { return startTime; }
    }  
    public virtual string PageRenderTime
    {
        get
        {
            renderTime = DateTime.Now - startTime;
            return renderTime.Seconds + "." + renderTime.Milliseconds + " seconds";
        }
    }       
}

I would then call the method on my Master Page like so:

<div id="performance">
     <% =PageRenderTime %>
</div>

Q: How do I accomplish the same thing with the MVC Framework?

Q: With the MVC framework where do I set the start time when a page is first created?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T03:46:40+00:00Added an answer on May 18, 2026 at 3:46 am

    The best way to do this is calculate the request timing .. Begin Request and End Request ….
    Check out this great post:

    http://haacked.com/archive/2008/07/02/httpmodule-for-timing-requests.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say, I want to calculate the time taken to load a ASP.NET page. When
I want to calculate total memory used by a process in .net. Total memory
I need to calculate the total of an invoice. This invoice is created with
I'm using ASP.NET MVC and Azure Table Storage in the local development fabric. My
I'm trying to calculate the total lost machine time in the database. The columns
I keep getting zero as my time. I need to calculate the total time
How would I calculate the total time an activity has been displayed on the
What is the best way to calculate the total time spent by a registered
I wrote a program and now I want to calculate the total running time
I am building a quiz and i need to calculate the total time taken

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.