View Single Post
  #9 (permalink)  
Old May 22nd, 2005, 11:08 AM
AGS AGS is offline
Wrox Technical Editor
Points: 267, Level: 5
Points: 267, Level: 5 Points: 267, Level: 5 Points: 267, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2005
Location: Russia
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Page 98
Performance testing of StringBuffer object versus string concatenation:
Code:
var oBuffer = new StringBuffer();
d1 = new Date();
for (var i=0; i < 10000; i++) {
oBuffer.append(“text”);
}
var sResult = buffer.toString();
d2 = new Date();
document.write(“<br />Concatenation with StringBuffer: “ + (d2.getTime() -
d1.getTime()) + “ milliseconds”);
misprint: buffer instead of oBuffer
Best regards,
Alexei

Reply With Quote