benchmarks.larceny/src/string.awk
raw| 1 | #! /usr/bin/awk -f |
| 2 | |
| 3 | function string( m ) { |
| 4 | for (i = 0; i < 10; i++) { |
| 5 | s = "abcdef" |
| 6 | while (length( s ) <= m) { |
| 7 | s = "123" s "456" s "789" |
| 8 | s_length = length( s ) |
| 9 | s = substr( s, s_length / 2 ) substr( s, 1, s_length / 2 ) |
| 10 | } |
| 11 | } |
| 12 | return length( s ) |
| 13 | } |
| 14 | BEGIN { |
| 15 | string( 500000 ) |
| 16 | } |