Yes, either before sunrise or after sunset for 21 times at a stretch on an empty stomach. However, if you begin your sadhana with Shiva Namaskar twice a day, ensure to do it twice daily for the entire 42 days. The same goes if you are starting the sadhana with Shiva Namaskar once a day.