Add timestamp support.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
// This script uses the Sieve of Eratosthenes to calculate prime numbers.
|
||||
|
||||
let now = timestamp();
|
||||
|
||||
const MAX_NUMBER_TO_CHECK = 10_000; // 1229 primes <= 10000
|
||||
|
||||
let prime_mask = [];
|
||||
@@ -24,3 +26,4 @@ for p in range(2, MAX_NUMBER_TO_CHECK) {
|
||||
}
|
||||
|
||||
print("Total " + total_primes_found + " primes.");
|
||||
print("Run time = " + now.elapsed() + " seconds.");
|
||||
|
@@ -1,6 +1,7 @@
|
||||
// This script runs 1 million iterations
|
||||
// to test the speed of the scripting engine.
|
||||
|
||||
let now = timestamp();
|
||||
let x = 1_000_000;
|
||||
|
||||
print("Ready... Go!");
|
||||
@@ -9,4 +10,4 @@ while x > 0 {
|
||||
x = x - 1;
|
||||
}
|
||||
|
||||
print("Finished.");
|
||||
print("Finished. Run time = " + now.elapsed() + " seconds.");
|
||||
|
Reference in New Issue
Block a user