// 処理速度比較テンプレート (2003/01/03) $$1 = ""; // 文字列型の引数 ##2 = 0; // 数値型の引数 ##Loop = 100; // 1試行あたりのループ回数 ##Repeat = 3; // 繰り返し試行回数 #debug = 0; goto Main; // 実行時間(ミリ秒/回) Case1: ##starttime=tickcount; while(#loopcount){ #loopcount=#loopcount-1;} return tickcount-##starttime; Case2: ##starttime=tickcount; while(#loopcount){ #loopcount=#loopcount-1;} return tickcount-##starttime; Case3: ##starttime=tickcount; while(#loopcount){ #loopcount=#loopcount-1;} return tickcount-##starttime; endmacro; Main: if (#debug) { ##Loop = 1; ##Repeat = 1; } if (updated) { question "保存しますか?"; if (result) { save; endmacro; } } disabledraw; while (##r < ##Repeat) { #loopcount = ##Loop; title "計測中 (" + str(##r + 1) + "/" + str(##Repeat) + ")"; call Case0 $$1, ##2; ##t0 = ##t0 + ##return; #loopcount = ##Loop; title "計測中 (" + str(##r + 1) + "/" + str(##Repeat) + ") Case1"; call Case1 $$1, ##2; ##t1 = ##t1 + ##return; #loopcount = ##Loop; title "計測中 (" + str(##r + 1) + "/" + str(##Repeat) + ") Case2"; call Case2 $$1, ##2; ##t2 = ##t2 + ##return; #loopcount = ##Loop; title "計測中 (" + str(##r + 1) + "/" + str(##Repeat) + ") Case3"; call Case3 $$1, ##2; ##t3 = ##t3 + ##return; ##r = ##r + 1; } if (#debug) endmacro; // 正規化 call Million (##t1 - ##t0) * (1000000 / ##Loop) / ##Repeat; $$t1 = $$return; call Million (##t2 - ##t0) * (1000000 / ##Loop) / ##Repeat; $$t2 = $$return; call Million (##t3 - ##t0) * (1000000 / ##Loop) / ##Repeat; $$t3 = $$return; // 結果書き出し gofiletop; searchdown "^// 実行時間", regular; if (result) down; call GetComputerName; insertfix "// " + month + "/" + day + " " + time + " " + $$return + " \t" + $$t1 + "\t" + $$t2 + "\t" + $$t3 + "\n"; endmacro; Case0: ##starttime=tickcount; while(#loopcount){ #loopcount=#loopcount-1;} return tickcount-##starttime; GetComputerName: // マシン名を取得 openreg "LOCALMACHINE", "SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ComputerName"; if (result) $$m = getregstr("ComputerName"); closereg; return $$m; Million: // 下3桁を落とし、3桁目に小数点を付ける $$v = str(##1); while (strlen($$v) < 7) $$v = "0" + $$v; $$v = leftstr($$v, strlen($$v) - 6) + "." + leftstr(rightstr($$v, 6), 3); return $$v; Confirm: // デバッグ用 enabledraw; question $$1; if (!result) endmacro; disabledraw; return;