DynamicInterval: reruns prepare code before next interval

Fixes #2152
This commit is contained in:
李通洲
2026-01-16 20:02:03 +08:00
parent 0f3db37199
commit 461552b8d0
5 changed files with 12 additions and 2 deletions
+2 -1
View File
@@ -9,7 +9,8 @@ static uint64_t startTime;
void ffPrepareCPUUsage(void)
{
assert(cpuTimes1.elementSize == 0);
if (cpuTimes1.elementSize != 0) return; // Already prepared
ffListInit(&cpuTimes1, sizeof(FFCpuUsageInfo));
ffGetCpuUsageInfo(&cpuTimes1);
startTime = ffTimeGetNow();
+2
View File
@@ -11,6 +11,8 @@ void ffPrepareDiskIO(FFDiskIOOptions* options)
{
if (options->detectTotal) return;
if (time1 != 0) return; // Already prepared
ffListInit(&ioCounters1, sizeof(FFDiskIOResult));
ffDiskIOGetIoCounters(&ioCounters1, options);
time1 = ffTimeGetNow();
+2
View File
@@ -9,6 +9,8 @@ void ffPrepareNetIO(FFNetIOOptions* options)
{
if (options->detectTotal) return;
if (time1 != 0) return; // Already prepared
ffListInit(&ioCounters1, sizeof(FFNetIOResult));
ffNetIOGetIoCounters(&ioCounters1, options);
time1 = ffTimeGetNow();
+5
View File
@@ -811,6 +811,11 @@ static void run(FFdata* data)
}
else
break;
if (useJsonConfig)
ffPrintJsonConfig(data, true /* prepare */);
else
ffPrepareCommandOption(data);
}
if (data->resultDoc)
+1 -1
View File
@@ -702,7 +702,7 @@ void ffLogoPrintLine(void)
printf("\033[%uC", instance.state.logoWidth);
if (instance.state.dynamicInterval > 0)
fputs("\033[K", stdout);
fputs("\033[K", stdout); // Clear to the end of the line
++instance.state.keysHeight;
}