Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,22 @@
Procedure Foo(Limit)
Protected i, palindromic, String$
For i=0 To Limit
String$=Str(i)
If String$=ReverseString(String$)
palindromic+1
EndIf
Next
ProcedureReturn palindromic
EndProcedure
If OpenConsole()
Define Start, Stop, cnt
PrintN("Starting timing of a calculation,")
PrintN("for this we test how many of 0-1000000 are palindromic.")
Start=ElapsedMilliseconds()
cnt=Foo(1000000)
Stop=ElapsedMilliseconds()
PrintN("The function need "+Str(stop-Start)+" msec,")
PrintN("and "+Str(cnt)+" are palindromic.")
Print("Press ENTER to exit."): Input()
EndIf

View file

@ -0,0 +1,14 @@
If OpenConsole()
Define Timed.f, cnt
PrintN("Starting timing of a calculation,")
PrintN("for this we test how many of 0-1000000 are palindromic.")
; Dependent on Droopy-library
If MeasureHiResIntervalStart()
; Same Foo() as above...
cnt=Foo(1000000)
Timed=MeasureHiResIntervalStop()
EndIf
PrintN("The function need "+StrF(Timed*1000,3)+" msec,")
PrintN("and "+Str(cnt)+" are palindromic.")
Print("Press ENTER to exit."): Input()
EndIf

View file

@ -0,0 +1,30 @@
Procedure.f ticksHQ(reportIfPresent = #False)
Static maxfreq.q
Protected T.q
If reportIfPresent Or maxfreq = 0
QueryPerformanceFrequency_(@maxfreq)
If maxfreq
ProcedureReturn 1.0
Else
ProcedureReturn 0
EndIf
EndIf
QueryPerformanceCounter_(@T)
ProcedureReturn T / maxfreq ;Result is in milliseconds
EndProcedure
If OpenConsole()
Define timed.f, cnt
PrintN("Starting timing of a calculation,")
PrintN("for this we test how many of 0-1000000 are palindromic.")
; Dependent on Windows API
If ticksHQ(#True)
timed = ticksHQ() ;start time
; Same Foo() as above...
cnt = Foo(1000000)
timed = ticksHQ() - timed ;difference
EndIf
PrintN("The function need " + StrF(timed * 1000, 3) + " msec,")
PrintN("and " + Str(cnt) + " are palindromic.")
Print("Press ENTER to exit."): Input()
EndIf