Raspberry BASIC > Programming Challenges

Just REM

(1/3) > >>

This thread is focused on the startup and shutdown costs of a programming language. The challenge is to time an empty program with just a REMark as its code.


--- Code: Script BASIC ---UNDEF Remark 

pi@RPi4B:~/sbrt/examples $ /usr/bin/time scriba updown.sb
0.00user 0.00system 0:00.01elapsed 60%CPU (0avgtext+0avgdata 1692maxresident)k
0inputs+0outputs (0major+99minor)pagefaults 0swaps
pi@RPi4B:~/sbrt/examples $


--- Code: Text ---REM 

pi@RPi4B:~/bacon-dev/examples $ bacon updown.bac
Converting 'updown.bac'... done, 2 lines were processed in 0.026 seconds.
Compiling 'updown.bac'... cc  -c updown.bac.c
cc -o updown updown.bac.o -lbacon -L. -lm 
Done, program 'updown' ready.
pi@RPi4B:~/bacon-dev/examples $ /usr/bin/time ./updown
0.00user 0.00system 0:00.00elapsed 100%CPU (0avgtext+0avgdata 1100maxresident)k
0inputs+0outputs (0major+75minor)pagefaults 0swaps
pi@RPi4B:~/bacon-dev/examples $


--- Code: FreeBasic ---REM 

pi@RPi4B:~/freebasic/examples $ fbc updown.bas
pi@RPi4B:~/freebasic/examples $ ls -l
total 28
-rwxr-xr-x 1 pi pi 23528 Nov 22 13:19 updown
-rw-r--r-- 1 pi pi     4 Nov 22 10:55 updown.bas
pi@RPi4B:~/freebasic/examples $ /usr/bin/time ./updown
0.00user 0.00system 0:00.01elapsed 58%CPU (0avgtext+0avgdata 2000maxresident)k
0inputs+0outputs (0major+118minor)pagefaults 0swaps
pi@RPi4B:~/freebasic/examples $

John Spikowski:
Python 3

--- Code: Python ---# 

pi@RPi4B:~/python-dev/examples $ /usr/bin/time python3 updown.py
0.07user 0.03system 0:00.10elapsed 98%CPU (0avgtext+0avgdata 7352maxresident)k
0inputs+0outputs (0major+733minor)pagefaults 0swaps
pi@RPi4B:~/python-dev/examples $

John Spikowski:

--- Code: Perl ---# 

pi@RPi4B:~/perl-dev/examples $ /usr/bin/time perl updown.pl
0.00user 0.01system 0:00.01elapsed 91%CPU (0avgtext+0avgdata 3880maxresident)k
0inputs+0outputs (0major+182minor)pagefaults 0swaps
pi@RPi4B:~/perl-dev/examples $


[0] Message Index

[#] Next page

Go to full version