]> gitweb.factorcode.org Git - factor.git/commitdiff
benchmark.wrap: adding a wrap benchmark.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 3 Aug 2012 16:37:01 +0000 (09:37 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 3 Aug 2012 16:37:01 +0000 (09:37 -0700)
extra/benchmark/wrap/wrap.factor [new file with mode: 0644]

diff --git a/extra/benchmark/wrap/wrap.factor b/extra/benchmark/wrap/wrap.factor
new file mode 100644 (file)
index 0000000..7bd8d03
--- /dev/null
@@ -0,0 +1,10 @@
+! Copyright (C) 2012 John Benediktsson
+! See http://factorcode.org/license.txt for BSD license.
+USING: kernel math math.parser sequences wrap wrap.strings ;
+IN: benchmark.wrap
+
+: wrap-benchmark ( -- )
+    1,000 iota [ number>string ] map " " join
+    100 [ dup 80 wrap-string drop ] times drop ;
+
+MAIN: wrap-benchmark