2020-07-04 22:31:17 +02:00
|
|
|
require "benchmark"
|
|
|
|
require "ipc"
|
|
|
|
require "../test-ws"
|
|
|
|
|
|
|
|
ws_uri = "ws://localhost:1234/pong.JSON"
|
|
|
|
|
|
|
|
message = IPC::Message.from_json(%({ "mtype" : 3, "utype" : 30, "payload" : "coucou" }))
|
|
|
|
|
|
|
|
Benchmark.ips do |bm|
|
|
|
|
bm.report("connection") do
|
2020-10-01 17:43:32 +02:00
|
|
|
c = IPC::Client.new "pong"
|
2020-07-04 22:31:17 +02:00
|
|
|
end
|
|
|
|
|
2020-10-01 17:43:32 +02:00
|
|
|
bm.report("connection through websocket") do
|
|
|
|
tws = TestWS.new ws_uri
|
|
|
|
end
|
|
|
|
end
|