Literary/written. In modern prose you'll usually see it expanded as 一霎间 or 一霎时 (yīshàjiān, yīshàshí). Compare colloquial 一下子 yīxiàzi 'all of a sudden' or 一瞬间 yīshùnjiān 'in a blink' — same idea, different register.
memory
霎 has the rain radical 雨 on top because its original meaning is 'a brief shower of rain.' A passing rain shower → a fleeting moment. The image carries through directly.