Context. Recent observations of decayless transverse oscillations have revealed two branches in the relationship between period and loop length. One is a linear relationship, interpreted as a standing mode, while the other shows almost no correlation and has not yet been interpreted conclusively. Aims. We investigated the undersampling effect on observed periods of decayless oscillations. Methods. We considered oscillating coronal loops that closely follow the observed loop length distribution. Assuming that all oscillations are standing waves, we modelled a signal that represents decayless oscillations where the period is proportional to the loop length and the amplitude and phase are randomly drawn. We generated a downsampled signal from the original signal by considering different sample rates that mimic temporal cadences of telescopes, and analysed the periods for sampled signals using the fast Fourier transform. Results. When the sampling cadence approaches the actual oscillation period, there is a greater tendency to overestimate the periods in short loops. We find the same two branches in the relationship between loop length and period of the sampled signals as those seen in the observations. Conclusions. We find that long periods of decayless oscillations occurring in short loops could be the result of undersampling.