mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
testing/sched: fix off-by-one sample count in timerjitter
cur_cnt++ in the loop condition increments even when the loop body doesn't run, so avg is divided by one more sample than was collected. Signed-off-by: liang.huang <liang.huang@houmo.ai>
This commit is contained in:
parent
1d15c81f69
commit
2bcc6b96ea
1 changed files with 3 additions and 1 deletions
|
|
@ -195,8 +195,10 @@ static FAR void *timerjitter(FAR void *arg)
|
|||
param->max = 0;
|
||||
param->min = (unsigned long)-1;
|
||||
|
||||
while (param->cur_cnt++ < param->max_cnt)
|
||||
while (param->cur_cnt < param->max_cnt)
|
||||
{
|
||||
param->cur_cnt++;
|
||||
|
||||
/* Wait for SIGALRM */
|
||||
|
||||
if (sigwait(&sigset, &sigs) < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue