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
Raw Normal View History

2020-02-04 02:06:13 +01: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"
c.close
2020-02-04 02:06:13 +01:00
end
bm.report("connection through websocket") do
tws = TestWS.new ws_uri
end
end