Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,6 +1,6 @@
F do_work(x)
V n = x
L(i) 10000000
L(i) 0.<10000000
n += i
R n

View file

@ -1,31 +0,0 @@
with Ada.Calendar; use Ada.Calendar;
with Ada.Text_Io; use Ada.Text_Io;
procedure Query_Performance is
type Proc_Access is access procedure(X : in out Integer);
function Time_It(Action : Proc_Access; Arg : Integer) return Duration is
Start_Time : Time := Clock;
Finis_Time : Time;
Func_Arg : Integer := Arg;
begin
Action(Func_Arg);
Finis_Time := Clock;
return Finis_Time - Start_Time;
end Time_It;
procedure Identity(X : in out Integer) is
begin
X := X;
end Identity;
procedure Sum (Num : in out Integer) is
begin
for I in 1..1000 loop
Num := Num + I;
end loop;
end Sum;
Id_Access : Proc_Access := Identity'access;
Sum_Access : Proc_Access := Sum'access;
begin
Put_Line("Identity(4) takes" & Duration'Image(Time_It(Id_Access, 4)) & " seconds.");
Put_Line("Sum(4) takes:" & Duration'Image(Time_It(Sum_Access, 4)) & " seconds.");
end Query_Performance;

View file

@ -1,12 +1,12 @@
scope # Time a function
local procedure timeFunction( f :: procedure ) :: number
local proc timeFunction( f :: procedure ) :: number
local startTime := os.clock();
f();
return os.clock() - startTime # execution time in milliseconds
end;
local procedure toBeTimed()
local proc toBeTimed()
os.wait( 1.234 ) # sleep 1.234 seconds
end

View file

@ -4,20 +4,20 @@ import system'threading;
import system'math;
import extensions;
someProcess()
SomeProcess()
{
threadControl.sleep(1000);
Thread.sleep(1000);
new Range(0,10000).filterBy::(x => x.mod(2) == 0).summarize();
}
public program()
public Program()
{
var start := now;
someProcess();
SomeProcess();
var end := now;
console.printLine("Time elapsed in msec:",(end - start).Milliseconds)
Console.printLine("Time elapsed in msec:",(end - start).Milliseconds)
}

View file

@ -1,5 +0,0 @@
atom t
t = time()
some_procedure()
t = time() - t
printf(1,"Elapsed %f seconds.\n",t)

View file

@ -1,6 +1,6 @@
(function measure
(let [start result end] [(time) (... . args) (time)])
(str result " took " (- end start) "ms"))
"{result} took {- end start}ms")
(function fib n
(if (< n 2) n

View file

@ -1,12 +0,0 @@
function fun($n){
$res = 0
if($n -gt 0) {
1..$n | foreach{
$a, $b = $_, ($n+$_)
$res += $a + $b
}
}
$res
}
"$((Measure-Command {fun 10000}).TotalSeconds) Seconds"

View file

@ -1,5 +1,5 @@
-- 7 Aug 2025
include Settings
-- 24 Aug 2025
include Setting
arg count','prec
if count = '' then
count = 1e7