-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.php
More file actions
28 lines (20 loc) · 746 Bytes
/
demo.php
File metadata and controls
28 lines (20 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
require_once './vendor/autoload.php';
$app = new \Kurses\Application();
$eventLoop = $app->getEventLoop();
$screen = $app->getScreen();
$tabsManager = $screen->getManager();
$tab1 = $tabsManager->addTab('Tab One');
$tab2 = $tabsManager->addTab('Tab Two');
$memUsage = function() {
return "Memory: ".memory_get_usage();
};
$screen->addStatusBarNotifier($memUsage);
$eventLoop->every(function()use($tab1) {
$tab1->panel->addLine(sprintf("[%03d] %s",mt_rand(0,100),time()));
}, 5);
$eventLoop->every(function()use($tab2) {
$tab2->panel->addLine(sprintf("[%03d] %s",mt_rand(0,100),time()));
}, 500);
//$this->panel->addLine(sprintf("%s : [%03d] %s",$this->name, mt_rand(0,100),time()));
$eventLoop->start();