Well, of course you shouldn't place Wait into your main loop which you repeat 100.000 times.
You should make sure it's called no more than 10-100 times.
Here is an example:
Another thing you can try is to modify your function so that it will only generate part of your 100,000 tile map, for example 10,000 tiles.
When the function ends, it updates the progress bar and starts a timer for 0.1s.
After 0.1s the timer calls this function again and the next 10,000 tiles are generated.
Repeat this until the entire tile map is filled.