The high performance mode (H-mode) is one of the baseline plasma scenarios for the experimental fusion reactor ITER. This scenario features a periodic crash-like reorganization of the plasma pressure and the magnetic flux in the plasma core and plasma periphery. The core instability is often referred to as the sawtooth instability while the instability at the edge of the plasma is referred to as ELM. In this paper we present an algorithm for optimized (low latency, robust and high fidelity) real-time sensing of the crashes. The algorithm is based on time-scale wavelet theory and edge-detection. It is argued that detection of crashes has considerably less delay than the other methods. The realized accuracy of the detection algorithm is well below the uncertainty of the crash period for most crashes. Multiresolution analysis enables distinction between different sizes of sawtooth crashes due to the different sizes of wavelets (scales), resulting in an algorithm, which is robust and accurate. Although strictly speaking, the crash detection method is demonstrated for sawteeth measured with ECE only, it can be applied to any periodic crash, measured with any temporally resolved data. Note that the possibility of differentiating between crash like events of different nature depends on their individual time-scales and used measurement setup.