How did they count and measure the waves and wavelengths without the units of time like seconds and measures of length?
What I am missing?
They didn't count or measure waves or frequencies. They measured wavelengths proportionally relative to the length of the monochord they were using at the time.
They had no way to put an absolute number on the frequency of any pitch, but they didn't need that: it doesn't stop them from developing a theory of intervals based on the monochord. The theory of intervals is based on the ratio of various lengths of string with identical mass and tension. The frequencies of standing waves in such lengths of string are proportional to their lengths.
So, they found that a monochord vibrating along 2/3 of its length sounded the pitch a fifth above that produced when the same monochord vibrated along its entire length, and when it vibrates along half its length the result is an octave higher, and so on.
You don't even need units of length to do this (other than the unit system based on the length of a given monochord), but the ancient Greeks did indeed have units of length.
They did not need to divide, for example, 880 cycles per second by 440 cycles per second to get the ratio 2:1, nor did they need to divide a length of 60 cm by 30 cm. They just needed to observe that the lower pitch was produced by a string that was twice as long as the string producing the higher pitch.
Don't forget that the ancient Greeks were very good in mathematics, especially geometry.
Measurement of frequency would not have been possible without a sufficiently precise and accurate way to measure time. As far as I can tell, having looked into this for another question recently, this wasn't possible before the invention of the pendulum clock in the 17th century. This allowed the measurement of time from an accuracy of 15 minutes per day to 15 seconds per day. I haven't found out when it was actually done for the first time, but it was certainly before the early 19th century. I would guess it was done in the 18th century.
I am also a bit unsure about the precision side of it: how do you know that something has vibrated 440 times during your second of timing rather than 441 or 439? A brief look at Helmholtz suggests that this may have been done by precisely controlling the rate of revolution of a siren and then tuning another pitch to match it. I would be surprised if people were doing this much before the 18th century.