The aim of this work is to obtain a reliable estimation of the remaining lifetime of power-electronic modules. Lifetime models provide information on the fatigue durability of power modules under repetitive loading circumstances. However, the thermo-mechanical stresses that a device is exposed to during operation are different than the ones evaluated to create the lifetime models. Rainflow counting provides a tool to analyze and evaluate the stress content of a randomly varying stress waveform, but counting stress cycles while the device is operating is challenging. In this paper, implementation challenges for an online rainflow-counting method are presented, and solutions to overcome them are discussed. An algorithm for online rainflow counting is implemented, and numerical results from tests on experimental device-temperature data are presented.