'Non-UI application (console / server application)
#Region Project Attributes
#CommandLineArgs:
#MergeLibraries: True
#End Region
Sub Process_Globals
End Sub
Sub AppStart (Args() As String)
Dim Person, Person2 As Map
Person.Initialize
Person2.Initialize
For x=0 To 100
Person2.Put("m" & x,Rnd(0,x+1))
Next
Dim Start As Long = DateTime.Now
For Each K As String In Person2.Keys
Person.Put(K,Person2.Get(K))
Next
PrintTookTime(Start,"For Each")
Person.Clear
Start = DateTime.now
JavaMapMerge(Person,Person2)
PrintTookTime(Start,"JavaMapMerge")
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
Sub JavaMapMerge(map1 As Map, map2 As Map)
Dim m1 As JavaObject = map1
Dim m2 As JavaObject = map2
m1.RunMethod("putAll", Array(m2))
End Sub
Sub PrintTookTime(Start As Long, MethodName As String)
Log($"${MethodName} took: ${DateTime.Now-Start} ms"$)
End Sub