3
0
Fork 0
websocketd/tests/performances/ipc_connection.cr

24 lines
461 B
Crystal
Raw 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" }))
pong = IPC::Connection.new "pong"
Benchmark.ips do |bm|
bm.report("connection") do
c = IPC::Connection.new "pong"
end
end
#puts "sleeping 5 seconds"
#sleep 5
#
#Benchmark.ips do |bm|
# bm.report("connection through websocket") do
# tws = TestWS.new ws_uri
# end
#end