Measuring Pulse Width

Is it possible to use this sketch to measure two signals at this same time?
Both signals start in the same moment but they have different period.