
In the ASP.NET Framework, every HTTP request to the runtime will have a timestamp stored automatically. You can access this DateTime value through the Timestamp property, which reads a DateTime backing field. I describe the HttpContext Timestamp property and elaborate on some specifics of its usage.
This ASP.NET article shows the Timestamp property on HttpContext.
To start, you will need an ASP.NET web application or project and you can change the Page_Load event in the code-behind file to use the Timestamp property. The Timestamp property does not read the current time; it only reads a DateTime field that was already automatically set upon each HTTP request. Therefore, using the Timestamp property is much faster than using DateTime.Now or computing the time in any other way.
Page that uses Timestamp property [C#]
using System;
using System.Web.UI;
namespace WebApplication8
{
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
var response = base.Response;
var context = base.Context;
// Write the timestamp to the page.
// ... This will not change if called later on the same request.
response.Write(context.Timestamp);
}
}
}
Output
3/3/2010 8:37:12 AM
Alternative calling convention. Often, using the HttpContext.Current.Timestamp property is convenient, because it accesses a static property. However, when possible, it is best to call the base pointer to acquire the Response and Context; this is faster in benchmarks because it does not require any threading checks.

The Timestamp property stored on an instance of the HttpContext type is a useful and fast way to access the start time of a request to your web site. Instead of accessing the system clock, it will return the value of a DateTime that was already filled, meaning only a few bytes are copied in memory rather than any clock operations. For many requirements, then, the Timestamp property is ideal for time-oriented request handling.
ASP.NET Tutorials