Static stretching -how long to wait before working out?

Sometimes when i wake up im super tight and sore, so i want to do some static stretches to loosen up and feel good. But if i still want to do weights or hiit or another workout later that day, how long do you guys usually wait before jumping into a warm up and working hard? I couldnt seem to find a good answer online when i searched; just that you shouldnt workout right after.