Timing properties of ULX pulsars: optically thick envelopes and outflows