4 |
|
|
5 |
StringBuilder sb = new StringBuilder(); |
StringBuilder sb = new StringBuilder(); |
6 |
|
|
7 |
public void addString(long start, String str) { |
long start = System.currentTimeMillis(); |
8 |
|
|
9 |
|
public void addString(String str) { |
10 |
long now = System.currentTimeMillis(); |
long now = System.currentTimeMillis(); |
11 |
long diff = now - start; |
long diff = now - start; |
12 |
|
|
27 |
public void clear() { |
public void clear() { |
28 |
synchronized(sb) { |
synchronized(sb) { |
29 |
sb.setLength(0); |
sb.setLength(0); |
30 |
|
start = System.currentTimeMillis(); |
31 |
} |
} |
32 |
|
|
33 |
} |
} |
39 |
public static ResultBuffer getResultBuffer() { |
public static ResultBuffer getResultBuffer() { |
40 |
if (singleton == null) { |
if (singleton == null) { |
41 |
singleton = new ResultBuffer(); |
singleton = new ResultBuffer(); |
42 |
} |
singleton.clear(); |
43 |
|
} |
44 |
|
|
45 |
return singleton; |
return singleton; |
46 |
} |
} |
47 |
} |
} |