使用
stack ghci --profile --ghci-options '+RTS -xc -RTS'
我明白了:
ghc: the flag -xc requires the program to be built with -prof
哪个程序不是使用-prof
构建的,为什么?
答案 0 :(得分:0)
build:
library-profiling: true
executable-profiling: true
以上似乎对我有用(确实需要几秒钟才能启动)。我必须将以下内容添加到stack build --enable-library-profiling
:
start.php
更多信息: https://github.com/commercialhaskell/stack/blob/master/doc/GUIDE.md#debugging http://simonmar.github.io/posts/2016-02-12-Stack-traces-in-GHCi.html
我可能实际上运行了一些额外的命令,可能是<?php
require_once '/home/ubuntu/workspace/workerman/vendor/autoload.php';
use Workerman\Worker;
// Create a Websocket server
$ws_worker = new Worker("websocket://0.0.0.0:2346");
// 4 processes
$ws_worker->count = 4;
// Emitted when new connection come
$ws_worker->onConnect = function($connection)
{
echo "New connection\n";
};
// Emitted when data received
$ws_worker->onMessage = function($connection, $data)
{
// Send hello $data
$connection->send('hello ' . $data);
};
// Emitted when connection closed
$ws_worker->onClose = function($connection)
{
echo "Connection closed\n";
};
// Run worker
Worker::runAll();
。