3
0
websocketd/tests/performances/ipc_connection.cr

18 lines
354 B
Crystal
Raw Permalink Normal View History

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
c = IPC::Client.new "pong"
2020-07-04 22:31:17 +02:00
end
bm.report("connection through websocket") do
tws = TestWS.new ws_uri
end
end