1111void ffPrintCPUUsage (FFCPUUsageOptions * options )
1212{
1313 FF_LIST_AUTO_DESTROY percentages = ffListCreate (sizeof (double ));
14- const char * error = ffGetCpuUsageResult (& percentages );
14+ const char * error = ffGetCpuUsageResult (options , & percentages );
1515
1616 if (error )
1717 {
@@ -111,6 +111,12 @@ bool ffParseCPUUsageCommandOptions(FFCPUUsageOptions* options, const char* key,
111111 return true;
112112 }
113113
114+ if (ffStrEqualsIgnCase (subKey , "wait-time" ))
115+ {
116+ options -> waitTime = ffOptionParseUInt32 (key , value );
117+ return true;
118+ }
119+
114120 if (ffPercentParseCommandOptions (key , subKey , value , & options -> percent ))
115121 return true;
116122
@@ -136,6 +142,12 @@ void ffParseCPUUsageJsonObject(FFCPUUsageOptions* options, yyjson_val* module)
136142 continue ;
137143 }
138144
145+ if (ffStrEqualsIgnCase (key , "waitTime" ))
146+ {
147+ options -> waitTime = (uint32_t ) yyjson_get_uint (val );
148+ continue ;
149+ }
150+
139151 if (ffPercentParseJsonObject (key , val , & options -> percent ))
140152 continue ;
141153
@@ -156,10 +168,10 @@ void ffGenerateCPUUsageJsonConfig(FFCPUUsageOptions* options, yyjson_mut_doc* do
156168 ffPercentGenerateJsonConfig (doc , module , defaultOptions .percent , options -> percent );
157169}
158170
159- void ffGenerateCPUUsageJsonResult (FF_MAYBE_UNUSED FFCPUUsageOptions * options , yyjson_mut_doc * doc , yyjson_mut_val * module )
171+ void ffGenerateCPUUsageJsonResult (FFCPUUsageOptions * options , yyjson_mut_doc * doc , yyjson_mut_val * module )
160172{
161173 FF_LIST_AUTO_DESTROY percentages = ffListCreate (sizeof (double ));
162- const char * error = ffGetCpuUsageResult (& percentages );
174+ const char * error = ffGetCpuUsageResult (options , & percentages );
163175
164176 if (error )
165177 {
@@ -203,6 +215,7 @@ void ffInitCPUUsageOptions(FFCPUUsageOptions* options)
203215 ffOptionInitModuleArg (& options -> moduleArgs , "" );
204216 options -> separate = false;
205217 options -> percent = (FFColorRangeConfig ) { 50 , 80 };
218+ options -> waitTime = 200 ;
206219}
207220
208221void ffDestroyCPUUsageOptions (FFCPUUsageOptions * options )
0 commit comments