显示任务状态,同时显示堆状态。

This commit is contained in:
大石头X2 2017-02-25 15:15:01 +08:00
parent 4d8d16972f
commit f26089762e
1 changed files with 6 additions and 1 deletions

View File

@ -412,6 +412,8 @@ INROOT void TaskScheduler::SkipSleep()
if(ExitSleep) ExitSleep(); if(ExitSleep) ExitSleep();
} }
#include "Heap.h"
// 显示状态 // 显示状态
void TaskScheduler::ShowStatus() void TaskScheduler::ShowStatus()
{ {
@ -433,7 +435,10 @@ void TaskScheduler::ShowStatus()
debug_printf(" 平均 %dus 当前 ", ts ? ct/ts : 0); debug_printf(" 平均 %dus 当前 ", ts ? ct/ts : 0);
DateTime(now/1000).Show(); DateTime(now/1000).Show();
debug_printf(" 启动 "); debug_printf(" 启动 ");
TimeSpan(now).Show(true); TimeSpan(now).Show(false);
auto hp = Heap::Current;
debug_printf(" 堆 %d/%d\r\n", hp->Used(), hp->Count());
// 计算任务执行的平均毫秒数,用于中途调度其它任务,避免一个任务执行时间过长而堵塞其它任务 // 计算任务执行的平均毫秒数,用于中途调度其它任务,避免一个任务执行时间过长而堵塞其它任务
int ms = ct / 1000; int ms = ct / 1000;