Introduction to ASP Programming (VII): built-in Object Server
Source: Internet
Author: User
The server object provides access to methods and properties on the server, where most of the methods and properties serve as functional services for the utility. (IIS help translation)
With the server object, you can start ActiveX object routines on the server and use the Active Server service to provide functions such as HTML and URL encoding.
One, Script.scripttimeout
After the script runs for more than a period of time, the timeout is processed.
The server general default script run time is 90 seconds.
As you can see from the Properties pop-up box in the default Web site in Internet Information Services, you can also set it yourself.
Oh, the above is not, 900 seconds.
It should be the same as WinXP in the Configuration dialog box in the Home Directory tab.
Before understanding the script run time, first look at a program, the main function is to calculate the Web page execution time.
<script language=vbs>
Startime=timer ()
Following is the content of the Web page
For i= 1 to 5000 step 20
document.write ("Next
End time
Endtime=timer ()
document.write ("Page Execution Time:" &formatnumber (Endtime-startime) *1000,3) & "MS")
</script>
[Ctrl + A ALL SELECT hint: You can modify some of the code, and then run]
Of course, the corresponding ASP is to see many sites have page execution time display
1,time.asp
<%startime=timer ()%>
<a href= #bot > to below to see the execution time </a>
<%
For i= 1 to 5000
Response.Write ("Next
%>
Of course, the middle can add other content. <br>
<%endtime=timer ()%>
<a name=bot></a>
<%=formatnumber ((endtime-startime) *1000,3)%> ms
So if the above program becomes for i= 1 to 5000000
Oh, is not the machine quick reaction does not come over the feeling, that this is the execution time of the script.
In order for the program to perform well, the execution time of the script should be extended.
How long? Change the default? Oh, of course not:)
<%Server.ScriptTimeout=110%>
The time set of course if than the default 90 seconds large, now the code is: Specify the server processing script in 110 seconds after the timeout.
Also, the determination of the script time to see its own program, the general situation of 100 seconds or so almost, even if it can be carried out, the person may be watching the Web page has already fork it.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service