I have done some research and I have come to the conclusion that the code is running 
under the ASPNET account and not the IUSR_MACHINENAME account. 
By default, when a request comes through the ASP.NET engine, the request is made using 
an ASPNET user account (as specified in the machine.config file). 
You can specify that ASP.NET requests be treated as a system-level account. 
To do this, open up machine.config found in :
'C:\WINNT\Microsoft.NET\Framework\v1.0.3705\CONFIG'
and find the processModel setting. In it, change the UserName attribute from machine 
(or ASPNET) to SYSTEM.

Note: It is not advisable to change this setting.

I have tried using UserProcessorTime in an aspx page, however I was unable to get the 
duration. The start time and end times were the same!!

If I were you I would do something simple, e.g. see below:

TimeSpan tsStart = TimeSpan.FromMilliseconds(Environment.TickCount);
//Do stuff here.                        
TimeSpan tsEnd = TimeSpan.FromMilliseconds(Environment.TickCount);
Response.Write("Duration: ");                                           
Response.Write(tsEnd.Subtract(tsStart));                                               
 
Response.Write("<BR>");


-----Original Message-----
From: Mattias Konradsson [mailto:[EMAIL PROTECTED]]
Sent: 15 April 2002 16:14
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET] Measuring performance


>From: "Donal Devine" <[EMAIL PROTECTED]>
>Do you have allow anonymous access turned on? - if so IIS is probably
trying to run the code under the >security context of the IUSR_MACHINENAME
account.

Yeah, it's turned on.. what's the solution here? It doesnt seem like a good
idea to run the entire application
is unrestricted account just to be able  to measure execution time. It isn't
just for optimizing but for displaying to users how long their search took
so I can't just enable it temporarily either..

Best Regards
----
Mattias Konradsson
"Reinventing the wheel since 1977"

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to