Do not do this!
Check with the 401k administrator and ask how quickly they process withdrawals. Many administrators process the within a week right to your bank account. Also ask if they allow loans from the 401k, often this is like borrowing from yourself as any interest you pay just goes to your account. The benefit here is that there are no withdrawal penalties unless you dont pay the money back and it does not report to your credit and tank your scores at the wrong time.
If you can get the money quickly, then find another method for emergency funds. Maybe you can use a credit card or line of credit that allows no fee cash advance transfers to your checking. Many credit unions allow this and some banks too.
If you do find yourself in a bind for actual cash and it is not something that could go on a credit card, you would then have access to cash without penaltys or fees (just interest).
If the need was there, you could later do a withdrawal or loan from your 401k to cover the need and pay off the credit card or line of credit.