g | x | w | all
Bytes Lang Time Link
07171 bytes250825T200134Zjlab
200200 bytes250722T190525Zcorvus_1

71 bytes

\documentclass{ncc}\document\ifnum\PreviousTotalPages=0X\fi\enddocument

EDIT: 2 bytes saved by changing the document class and removing the useless carriage return.

Explanation

\PreviousTotalPages returns the previous number of pages (or zero at the first run). The document is empty if \PreviousTotalPages is non-zero, and contains a single page (with the single character X) if \PreviousTotalPages is zero.

This solution then oscillates with a period of 2.

200 bytes

\documentclass{ncc}\usepackage{tikz,datetime2}\global\let~\dospecials\gdef\dospecials{~\catcode`|=0}
\begin{filecontents}[force]{x.tex}
|DTMnow
\end{filecontents}
\begin{document}\input{x}\enddocument

Writes an expanded \DTMnow (the current date and time) to x.tex. Latexmk tracks this dependency and reruns the compiler.

The tikz package is included to make the compile time be longer than one second on an typical machine.