スクリプトの実行を指定の時間だけ止めます。
// 誤差調べ
// 注: GetTickCount() と Sleep() の両方に誤差があります.
var sys = Application.System;
var interval, t1, t2, n;
for (interval = 500; interval <= 1000; interval += 100) {
for (n = 10; n; --n) {
t1 = sys.GetTickCount();
Script.Sleep(interval);
t2 = sys.GetTickCount();
Script.Echo(t2 - t1, "(誤差", t2 - t1 - interval, "ms)");
}
}
' 誤差調べ
' 注: GetTickCount() と Sleep() の両方に誤差があります.
Dim sys
Set sys = Application.System
Dim interval, t1, t2, n
For interval = 500 To 1000 Step 100
For n = 1 To 10
t1 = sys.GetTickCount
Script.Sleep interval
t2 = sys.GetTickCount
Script.Echo t2 - t1, "(誤差", t2 - t1 - interval, "ms)"
Next
Next
Sazanami Help
Copyright (c) 2023 Narumi Watanabe.
All Rights Reserved.