
Tom
By: a guest on Apr 15th, 2009 | syntax:
VisualBasic | size: 0.69 KB | hits: 189 | expires: Never
dim nDic as new Dictionary
dim i as integer
dim x as integer
dim tTimer as int64 = microseconds()
for i = 1 to 1000000
//Generate a random UUID
dim pUUID as String
for x = 1 to 16
pUUID=pUUID+chr(round(rnd*255)+1)
next x
//Check if pUUID exists in the dictionary
if ndic.HasKey(pUUID) = false then
//If not, add it to the dictionary
ndic.Value(pUUID)=pUUID
end if
next i
tTimer = microseconds() - tTimer //Stop the clock!
print "Operation completed in "+str(tTimer / 1000000)+" seconds"
print str(ndic.count)+" keys in dictionary"
//Keep the window open at the end of the test
do
app.DoEvents
loop