What difference between readString and while loop read
Your while loop reads all the characters up until it reaches character 0 (it also has a timeout, although the timeout has been coded wrong since it can't deal with clock rollover). The .readString() method reads characters until no characters arrive within a timeout period (1s if memory serves me correctly).

Your while loop is the more reliable method since it uses a specific delimiter to identify blocks of data (strings) rather than assuming that:


The string will all arrive with no delays greater than the timeout
The strings will be sent with a gap of at least the timeout length between them.


Personally I would never recommend using any of the "helpful" functions provided for reading from a Stream object other than the basic .read() function.