Updated thread sleeping and frame skipping.