Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
35
Task/Rate-counter/ERRE/rate-counter.erre
Normal file
35
Task/Rate-counter/ERRE/rate-counter.erre
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
PROGRAM RATE_COUNTER
|
||||
|
||||
!
|
||||
! for rosettacode.org
|
||||
!
|
||||
|
||||
!
|
||||
! This is an example, replace with the task you want to measure
|
||||
!
|
||||
PROCEDURE TASK_TO_MEASURE
|
||||
LOCAL I
|
||||
FOR I=1 TO 1000000 DO
|
||||
END FOR
|
||||
END PROCEDURE
|
||||
|
||||
BEGIN
|
||||
PRINT("Method 1: Calculate reciprocal of elapsed time:")
|
||||
FOR TRIAL%=1 TO 3 DO
|
||||
START=TIMER
|
||||
TASK_TO_MEASURE
|
||||
FINISH=TIMER
|
||||
PRINT("Rate =";100/(FINISH-START);"per second")
|
||||
END FOR
|
||||
|
||||
PRINT("Method 2: Count completed tasks in one minute:")
|
||||
FOR TRIAL%=1 TO 3 DO
|
||||
RUNS%=0
|
||||
FINISH=TIMER+60
|
||||
REPEAT
|
||||
TASK_TO_MEASURE
|
||||
IF TIMER<FINISH THEN RUNS%+=1 END IF
|
||||
UNTIL TIMER>=FINISH
|
||||
PRINT("Rate =";RUNS%;"per minute")
|
||||
END FOR
|
||||
END PROGRAM
|
||||
11
Task/Rate-counter/Sidef/rate-counter.sidef
Normal file
11
Task/Rate-counter/Sidef/rate-counter.sidef
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
var benchmark = frequire('Benchmark');
|
||||
|
||||
func job1 {
|
||||
#...job1 code...
|
||||
}
|
||||
func job2 {
|
||||
#...job2 code...
|
||||
}
|
||||
|
||||
const COUNT = -1; # run for one CPU second
|
||||
benchmark.timethese(COUNT, Hash.new('Job1' => job1, 'Job2' => job2));
|
||||
Loading…
Add table
Add a link
Reference in a new issue