Refactor limits checking/result setting into common function for linux and windows.
Convert all time intervals to time.Duration