I'm not familiar with PIC32 devices and the library provided by microchip, but from what I read in the peripheral library guide the call to
SYSTEMConfigPerformance(SYSTEM_FREQUENCY); does not set the actual clocks to 72MHz but just selects all other important features to give maximum performance for 72MHz (e.g. wait states, caches, peripheral clock pre divider).
So in your code the MCU will run with the default reset settings which are (if I understand correctly) 8MHz internal FRC clock with a divider of 2, so 4MHz. You could try to check this if you define
4000000L and see if you get a 1s delay. (currently it should be 18 seconds instead of 1)
If I am not mistaken, and you actually want your device to run on 72MHz, you have to configure your oscillators first:
OSCConfig(OSC_FRC_PLL, OSC_PLL_MULT_18, OSC_PLL_POST_1, OSC_FRC_DIV_2);
Note that the PLL input frequency should not exceed 5 MHz (if I got that right) so you will use the 8MHz FRC divide that by 2 (
OSC_FRC_DIV_2), feed it into the PLL (
OSC_FRC_PLL) and multiply it by 18 (
OSC_PLL_MULT_18) with no post divider (
OSC_PLL_POST_1). With a result of 72MHz +/- 2% at 25°C (as the FRC is calibrated that way).
As I'm really not familiar, please double check those things and don't hold me responsible if you kill your chip, the first suggestion (defining the system frequency lower) should be safe.