Literary/written. In modern prose you'll usually see it expanded as 一霎间 or 一霎时. Compare colloquial 一下子 'all of a sudden' or 一瞬间 '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 goes to a fleeting moment. The image carries through directly.