Apparatus for measuring unknown time intervals by electric means