These two expressions are used in both hyphenated and non-hyphenated form. Which do you use when?
In situ is a Latin expression meaning “in the place.” When used as an adverb, there is no hyphen; when used as an adjective, there is a hyphen.
The microbes for the project will be cultivated in situ. (adverb telling where cultivated)
The field will be developed using in-situ combustion. (adjective modifying combustion)
Similarly, real-time is hyphenated when used as an adjective, and not hyphenated when used as an adverbial phrase with the preposition “in.”
Fiber-optic cable enables temperature measurement in real time. (adverbial phrase telling when measured)
Real-time data are essential for directional drilling success. (adjective modifying data)
How shall we remember this?
If there is a noun right after it, hyphenate it. If not, don’t.