分散関数呼び出し
Posted feedbacks - JavaScript
テキストのみの通信にしちゃいました。 CPU 2.8G MEM 1G WinXP Pro IIS
で実行したところ、 こんな感じです。
販売価格 1,600円 (定価2,000から20%引き) st=1196494169386 et=1196494432558 10000回:263.172秒かかってまっせ。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | --HTML側(doukaku.html)
<html>
<meta http-equiv="Content-Type" content="text/html; charset=sjis">.
<body>
<script>
var st = new Date().getTime();
var ajax = false;
if(typeof ActiveXObject != "undefined"){
try { ajax = new ActiveXObject("Microsoft.XMLHTTP"); }
catch (e) { ajax = false; }
}
if(!ajax && typeof XMLHttpRequest != "undefined") ajax = new XMLHttpRequest();
var i = 0;
for(i = 0; i < 10000; i++){
ajax.open( 'GET','doukaku.asp?x=2000&y=20', false );
ajax.send( );
txt = ajax.responseText;
}
var et = new Date().getTime();
document.write('<div>' + txt + '</div>');
document.write('<div>st=' + st.toString() + '</div>' );
document.write('<div>et=' + et.toString() + '</div>' );
document.write('<div>' + i.toString() + '回:' + (et - st) / 1000 + '秒かかってまっせ。</div>' );
</script>
</body>
</html>
--SV側(doukaku.asp)
<%@ Language="JavaScript" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">.
<%
var q = Request.QueryString;
function getPricestring( x, y ){
x = x - 0; y = y - 0;
return "販売価格 " + f( ( x * ( 100 - y ) / 100 ) ) + "円 (定価" + f(x) + "から" + y + "%引き)";
function f( x ){
return x.toString().split('').reverse().join('').replace(/(\d{3})/g, '$1,').split('').reverse().join('');
}
}
%>
<%=getPricestring(q('x'),q('y'))%>
|


沢渡 みかげ
#3401()
Rating0/0=0.00
[ reply ]