code for two motors

Will Both motors rotate for 10 seconds, then Motor 1 will continue running for another 2 seconds, while Motor 2 will stop?

Correct, but that's not what you described in your first post, with both motors stopping after ten seconds