No, trying to even out times by matching is not what was suggested. Instead you make a sleep mechanism that ends uniformly. In this example you would always sleep until the ten second mark, valid or invalid.
Trying to make two code paths take the same time without waiting on an external timer is deep voodoo and should be left to experts.
Trying to make two code paths take the same time without waiting on an external timer is deep voodoo and should be left to experts.