Need timer function inside Chat class [SOLVED]
I have been studying how to do this but I have not found a working example. I am using the Chat script to receive messages from a variable number of clients. The messages are synchronized to arrived at about the same time. A timer shall be set or its value recorded on the first message. If after 3 seconds there are no more messages, received messages will be concatenated into one message and sent to a destination client. I think I would like to use either addPeriodicTimer() or addTimer().

For example I found this but it seems out of date. https://github.com/ratchetphp/Ratchet/issues/171
$loop is already defined so I get:

`PHP Fatal error:  Uncaught TypeError: Argument 1 passed to MyApp\Chat::__construct() must be an instance of MyApp\React\EventLoop\LoopInterface, instance of React\EventLoop\StreamSelectLoop given, called in /usr/bin/chat-server.php on line 9 and defined in /usr/src/MyApp/Chat.php:40`