How to query the system clock?
volatile uint32_t SysClockFreq = HAL_RCC_GetSysClockFreq();
  __NOP(); // &lt;- Breakpoint here


You may also be able to write an inline assembly loop and measure the execution time with a GPIO on an oscilloscope:

To approximately wait 1600 iterations in two nested for loops:

asm(
    "MOV  R8, #0      \n\t" // Initialize the counter
    "loop0:           \n\t"
    "ADD  R8, R8, #1  \n\t" // Increment it

    "MOV  R9, #0      \n\t" // Initialize the counter
    "loop1:           \n\t"
    "ADD  R9, R9, #1  \n\t" // Increment it
    "CMP  R9, #4000   \n\t" // Check the limit
    "BLE  loop1       \n\t" // Continue looping if not finished
    ";"
    "CMP  R8, #4000   \n\t" // Check the limit
    "BLE  loop0       \n\t" // Continue looping if not finished
    ";                \n\t"
  );