Next: Control Flow, Previous: kSQL, Up: k9: Manual
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.
System \l a.k load \t:n x timing \u:n x \v variables \w memory \cmd OS command
Load a text file of k9 commands. The file name must end in .k.
\l func.k \l func.k \l func.k9 / will error as not .k :nyi
List time elapsed in milliseconds in evaluting x. If n is supplied then repeat x, n times.
\t ^(_10e6)? _1e8 / sort 10 million numbers 227 \t:10 ^(_10e6)? _1e8 / perform 10 times the sort 2027
TBD
List variables
a:1;b:2;c:3 \v ,3 i|`a`b`c
List memory usage
\w 930 r:(_10e6)?10 \w 2098106
Run any valid command via OS.
\cd "/Users/user123/" \pwd ,"/Users/user123" \echo $PATH / query environmental variable ,"/opt/local/bin:/usr/bin:/bin"
Next: Control Flow, Previous: kSQL, Up: k9: Manual