Platforms to show: All Mac Windows Linux Cross-Platform
Required plugins for this example: MBS Util Plugin, MBS DataTypes Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/Ramstream speed test
This example is the version from Fri, 25th Jun 2015.
Project "Ramstream speed test.xojo_binary_project"
Class Window1 Inherits Window
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
dim i as integer
dim d as string
dim s as string
dim m as memoryBlock
dim t as integer
const count1=1000
const count2=10000
m=newmemoryBlock(1000)
s=m.stringValue(0,1000) // get a 1000 Byte long string
'SetEncodingOfStringMBS s,0 // Just in case RB doesn't set it.
s=DefineEncoding(s,Encodings.ASCII)
t=ticks
for i=1 to count1
d=d+s
next
t=ticks-t
staticText3.text=format(t,"0")
if CheckBox1.Value then
d=""
t=ticks
for i=1 to count2
d=d+s
next
t=ticks-t
staticText11.text=format(t,"0")
else
staticText11.text=""
end if
End EventHandler
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action()
dim r as RamStreamMBS
dim i as integer
dim s as string
dim d as string
dim m as memoryBlock
dim t as integer
const count1=1000
const count2=10000
m=newmemoryBlock(1000)
s=m.stringValue(0,1000) // get a 1000 Byte long string
t=ticks
r=CreateRamStreamMBS(1000*count1)
for i=1 to count1
r.write s
next
r.position=0
d=r.read(r.length)
t=ticks-t
staticText4.text=format(t,"0")
t=ticks
r=CreateRamStreamMBS(1000*count2)
for i=1 to count2
r.write s
next
r.position=0
d=r.read(r.length)
t=ticks-t
staticText12.text=format(t,"0")
End EventHandler
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control StaticText3 Inherits Label
ControlInstance StaticText3 Inherits Label
End Control
Control StaticText4 Inherits Label
ControlInstance StaticText4 Inherits Label
End Control
Control StaticText5 Inherits Label
ControlInstance StaticText5 Inherits Label
End Control
Control StaticText6 Inherits Label
ControlInstance StaticText6 Inherits Label
End Control
Control StaticText7 Inherits Label
ControlInstance StaticText7 Inherits Label
End Control
Control PushButton3 Inherits PushButton
ControlInstance PushButton3 Inherits PushButton
EventHandler Sub Action()
dim r as StringHandleMBS // in DataTypes Plugin
dim i as integer
dim s as string
dim d as string
dim m as memoryBlock
dim t as integer
const count1=1000
const count2=10000
m=newmemoryBlock(1000)
s=m.stringValue(0,1000) // get a 1000 Byte long string
t=ticks
r=new StringHandleMBS
for i=1 to count1
r.Add s
next
d=r.copy
t=ticks-t
staticText6.text=format(t,"0")
t=ticks
r=new StringHandleMBS
for i=1 to count2
r.Add s
next
d=r.copy
t=ticks-t
staticText13.text=format(t,"0")
End EventHandler
End Control
Control StaticText8 Inherits Label
ControlInstance StaticText8 Inherits Label
End Control
Control StaticText9 Inherits Label
ControlInstance StaticText9 Inherits Label
End Control
Control StaticText11 Inherits Label
ControlInstance StaticText11 Inherits Label
End Control
Control StaticText12 Inherits Label
ControlInstance StaticText12 Inherits Label
End Control
Control StaticText13 Inherits Label
ControlInstance StaticText13 Inherits Label
End Control
Control StaticText10 Inherits Label
ControlInstance StaticText10 Inherits Label
End Control
Control CheckBox1 Inherits CheckBox
ControlInstance CheckBox1 Inherits CheckBox
End Control
End Class
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu0 = "Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cut"
MenuItem EditCopy = "Copy"
MenuItem EditPaste = "Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class
End Project
The items on this page are in the following plugins: MBS Util Plugin.