Bunch length measurement in time domain for HLS