Obsolete
/
ipcd
Archived
3
0
Fork 0
This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues/pull-requests.
ipcd/tests/performances/ipc_connection.cr

19 lines
364 B
Crystal

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"
c.close
end
bm.report("connection through websocket") do
tws = TestWS.new ws_uri
end
end