xref: /php-uv/examples/debug_timer.php (revision 99312394)
1<?php
2$timer = uv_timer_init();
3
4$stat = array();
5$stat['begin'] = memory_get_usage();
6
7uv_timer_start($timer, 10, 1000, function($timer) use (&$stat) {
8    $stat["current"] = memory_get_usage();
9    printf("memory: %d\n", $stat["current"] - $stat['begin']);
10});
11
12uv_run();
13