Convert cycles to milliseconds from a frequency in Hz, kHz, MHz or GHz, convert ms back to cycles, or find the time of one cycle, such as 60 Hz in ms.
- All Unit Converters
- Clock Cycles Per Instruction Calculator
- Hz to ms Calculator
- Hz to Period Calculator
- Samples to ms Calculator
- Sampling Frequency Calculator
Calculator Functions
| Function | What it does | What it requires |
|---|---|---|
| Cycles to milliseconds | Converts a number of cycles into elapsed time at a set frequency | Requires the cycle frequency and the number of cycles. A blank count is treated as one cycle |
| Milliseconds to cycles | Finds how many cycles fit in a length of time | Requires the cycle frequency and the elapsed time |
| Frequency from cycles and time | Finds the frequency in hertz from a count of cycles and how long they took | Requires the number of cycles and the elapsed time |
Frequency can be entered in Hz, kHz, MHz or GHz, and time in ns, µs, ms, s or min. Hz is the same as cycles per second (cps). Every result lists the elapsed time in ms, s and min, the cycle count, the frequency in Hz and the time one cycle takes.
Cycles to ms Formulas
| ms | Elapsed time in milliseconds |
| C | Number of cycles |
| F | Frequency in hertz. One hertz is one cycle per second [1] |
One cycle lasts 1 ÷ F seconds, which is the period of the signal [2]. C cycles last C times as long, and multiplying by 1,000 turns seconds into milliseconds.
Cycles to milliseconds
The main formula applies directly. On 60 Hz mains power one cycle is 1 ÷ 60 × 1,000 = 16.667 ms, and 3 cycles are 50 ms. On a 50 Hz supply one cycle is 20 ms. For a processor, 500 clock cycles at 2.5 GHz take 500 ÷ 2,500,000,000 × 1,000 = 0.0002 ms.
Hz or cps to Milliseconds Per Cycle
A rate in cycles, clicks or frames per second converts to the gap between events in the same way: 12 cps is 1,000 ÷ 12 = 83.333 ms between cycles. Leaving the number of cycles blank in the calculator gives this figure.
| Frequency (Hz or cps) | Time per cycle (ms) |
|---|---|
| 1 | 1,000 |
| 2 | 500 |
| 4 | 250 |
| 5 | 200 |
| 8 | 125 |
| 10 | 100 |
| 12 | 83.333 |
| 13 | 76.923 |
| 15 | 66.667 |
| 20 | 50 |
| 30 | 33.333 |
| 50 | 20 |
| 60 | 16.667 |
| 100 | 10 |
| 120 | 8.333 |
| 240 | 4.167 |
| 1,000 (1 kHz) | 1 |
| 1,000,000 (1 MHz) | 0.001 |
Milliseconds to cycles
100 ms at 60 Hz is 60 × 100 ÷ 1,000 = 6 cycles, and the same 100 ms at 50 Hz is 5 cycles.
| Time (ms) | Cycles at 50 Hz | Cycles at 60 Hz |
|---|---|---|
| 10 | 0.5 | 0.6 |
| 20 | 1 | 1.2 |
| 50 | 2.5 | 3 |
| 100 | 5 | 6 |
| 250 | 12.5 | 15 |
| 500 | 25 | 30 |
| 1,000 | 50 | 60 |
Frequency from cycles and time
5 cycles counted in 100 ms is 5 ÷ 0.1 = 50 Hz. Both the cycle count and the time must be greater than zero.
Limits of This Estimate
- The frequency is assumed constant for the whole interval. A signal that speeds up, slows down or pauses gives a different elapsed time.
- For processors, a clock cycle is not a completed instruction. Instructions can take several cycles, and stalls and changing clock speeds mean cycle time is not the same as how long a program takes.
- A time in electrical cycles assumes the supply is exactly at its nominal 50 or 60 Hz.
Sources
- NIST Time and Frequency Division, Time and Frequency from A to Z: H: the hertz as one cycle per second
- NIST Time and Frequency Division, Time and Frequency from A to Z: P: period as the reciprocal of frequency, T = 1 / f
