As said, if it's jailbroken, this wont work at all.
The only exception is the anything iPhone 3G or older - it can take hours, since it actually has to delete anything. On the newer phones, it just deletes the encryption keys, then recreates default settings whiles which takes about 2 minutes.