A gas ejection apparatus ejects gas by use of a compressor that compresses the gas, and the gas ejection apparatus includes a detector and a microcomputer. The detector detects a signal relating to an ejection target device. The microcomputer controls the compressor to change a number of times of ejection of the gas in accordance with an amount of time elapsing between a detection of the signal by the detector and a next detection of the signal by the detector.