|
|
|
|
|
by rovolo
497 days ago
|
|
I agree that the time unit should be in the variable name. The code itself should do a good job of explaining "what" is happening, but you generally need comments to explain "why" this code exists. Why is the test advancing the time, and why are we advancing the time at this line of the test? networkTimeMs++; // Callback occurs after timeout
timeSec++; // Advance time to check whether dependent properties update
utcTime++; // Leap second, DON'T advance ntpTime
|
|
Also a terrible solution!
The code suffers from primitive obsession. Unless you're in a code section that is known to have performance issues, use real types.