1761
|
1 |
"{ Package: 'stx:libjava/benchmarks' }"
|
|
2 |
|
|
3 |
JavaBenchmark subclass:#Strcat
|
|
4 |
instanceVariableNames:''
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Benchmarks-Java-Micro'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!Strcat methodsFor:'running'!
|
|
12 |
|
1762
|
13 |
runBenchmarkS:n
|
|
14 |
| stream hello |
|
|
15 |
|
|
16 |
stream := WriteStream on:String new.
|
|
17 |
hello := 'hello' , Character cr asString.
|
|
18 |
10 timesRepeat:[
|
|
19 |
stream nextPutAll:hello
|
|
20 |
].
|
|
21 |
^ Time
|
|
22 |
millisecondsToRun:[
|
1781
|
23 |
1 to: n do: [:idx|
|
1762
|
24 |
stream nextPutAll:hello
|
|
25 |
].
|
|
26 |
].
|
1761
|
27 |
! !
|
|
28 |
|
|
29 |
!Strcat class methodsFor:'documentation'!
|
|
30 |
|
|
31 |
version_SVN
|
|
32 |
^ '$Id:: $'
|
|
33 |
! !
|