Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These changes enable my Linux set-up (details below) to pass the final offloading tutorial step. They are in this PR to create a discussion on whether they are necessary, or are due to other issues.
Edit: This may be the same problem reported in #38.
Without these changes, the actual sleep time exceeds the upper bound on both checks. For the first check, the sleep time is approx 370ms, and for the second, approx 1400ms. From memory and a quick google search, the time provided to Windows Sleep() is considered a guide only, and a wake time of 111ms is a bit on the low side. I have no personal coding experience of usleep() to comment on.
My set-up: Oracle VirtualBox VM running Ubuntu 12.04 LTS (32-bit) on a Windows host machine.
Testing: the changes have been tested as follows:
After creating a fork of goingnative, I copied my solution folder "myaddon" to the goingnative folder, and made the edits to the relevant exercise.js (in the "exercises\offloading*" folder). The code was tested several times in debug and normal mode.
The code was debugged with node-inspector:
node-debug goingnative.js verify myaddon
The code was also run with the same command line, but just with node.