I understand that your B permit is valid until its stated expiry date -- regardless of whether you're in Switzerland or not. I may be wrong, though ...
This thread has some useful information, but it's a few years old now:
B Permit Holders Leaving Switzerland - Can We Keep Our B Permits. The answer to your question depends on your nationality, how long you want to travel outside Switzerland, and whether you'll maintain a home here while you're travelling ... among other things.