Next: , Previous: , Up: Top  

14 System

k9 comes with a few system functions and measurement commands. The commands allow you to load a script, change the working directory, measure execution times and memory usage, and list defined variables.

\l a.k load
\t:n x timing
\v     variables
\w     memory
\cd x  cd

14.1 load ⇒ \l a.k

Load a text file of k9 commands. The file name must end in .k.

 \l func.k
\l func.k
 \l func.k7  / will error as not .k

14.2 timing ⇒ \t x or \t:n x

List time elapsed in milliseconds in evaluting x. If n is supply then repeat x, n times.

 \t ^(_10e6)rand _1e8     / sort 10 million numbers

 \t:10 ^(_10e6)rand _1e8  / perform 10 times the sort

14.3 variables ⇒ \v

List variables


14.4 memory ⇒ \w

List memory usage

 r:(`i$10e6)rand 10

14.5 cd ⇒ \cd x

Change directory (cd) into x

 \cd scripts