New to ESP32, need help with timer interrupt!

#include <Arduino.h>

volatile int i = 0; // Make datatype volatile if it is changed by ISR or hardware
hw_timer_t *myTimer = NULL; // Initialize the timer variable

// Pin definitions
const int SevSegA = 19;
const int SevSegB = 18;
const int SevSegC = 17;
const int SevSegD = 16;
const int SevSegE = 23;
const int SevSegF = 22;
const int SevSegG = 1; // (TX Pin)
const int SevSegSwitch = 26;
const int SevSegSwitch2 = 27;

int firstDig = 0;
int secondDig = 0;

// Digit codes for 7-segment display (common anode)
const byte Digits[10] = {
  0b00111111,  // 0
  0b00000110,  // 1
  0b01011011,  // 2
  0b01001111,  // 3
  0b01100110,  // 4
  0b01101101,  // 5
  0b01111101,  // 6
  0b00000111,  // 7
  0b01111111,  // 8
  0b01101111   // 9
};

// Interrupt Service Routine (ISR)
void IRAM_ATTR ISRTMR() {
  i++;
  if (i > 99) {
    i = 0;
  }
}

// Setup function runs once when you press reset or power the board
void setup() {
  // Initialize the digital pins as outputs
  pinMode(SevSegA, OUTPUT);
  pinMode(SevSegB, OUTPUT);
  pinMode(SevSegC, OUTPUT);
  pinMode(SevSegD, OUTPUT);
  pinMode(SevSegE, OUTPUT);
  pinMode(SevSegF, OUTPUT);
  pinMode(SevSegG, OUTPUT);
  pinMode(SevSegSwitch, OUTPUT);
  pinMode(SevSegSwitch2, OUTPUT);
  
  myTimer = timerBegin(1); // Initialize timer
  // 0 means we start counting from 0
  // 80 is prescaler (Clock is 80MHz) so its 1MHz now, true means count up
  
  timerAttachInterrupt (myTimer, &ISRTMR); // Attach ISR to timer
  // myTimer is our timer, ISRTMR is the ISR, true means on edge interrupt
  
  timerWrite(myTimer, 1000000); // Set alarm
  // it means myTimer will count 1 million times (1 second) and true means it should restart counting each time
  
  timerStart(myTimer); // Enable the timer alarm
}

// Loop function runs over and over again forever
void loop() {
  firstDig = i % 10;
  secondDig = i / 10; // i modulo 10 gives the first digit and div by 10 gives the second

  // Display first digit
  digitalWrite(SevSegSwitch, LOW);   // Enable the first digit (common anode)
  digitalWrite(SevSegSwitch2, HIGH); // Disable the second digit
  displayDigit(Digits[firstDig]);
  delay(10);
  
  // Display second digit
  digitalWrite(SevSegSwitch, HIGH);  // Disable the first digit
  digitalWrite(SevSegSwitch2, LOW);  // Enable the second digit (common anode)
  displayDigit(Digits[secondDig]);
  delay(10); // Adjust this value to control the overall display refresh rate
}

// The function below takes SegCode as a parameter which is a byte that contains which segments of the 7-seg are on (1) and off (0)
void displayDigit(byte SegCode) {
  digitalWrite(SevSegA, !bitRead(SegCode, 0));
  digitalWrite(SevSegB, !bitRead(SegCode, 1));
  digitalWrite(SevSegC, !bitRead(SegCode, 2));
  digitalWrite(SevSegD, !bitRead(SegCode, 3));
  digitalWrite(SevSegE, !bitRead(SegCode, 4));
  digitalWrite(SevSegF, !bitRead(SegCode, 5));
  digitalWrite(SevSegG, !bitRead(SegCode, 6));
}

This is my code, I know it may be very badly written, however I just need to know how to configure the timer and interrupt properly! I am also aware of the comments that are badly written haha.
EDIT: I think that the frequency I was supposed to put in as a parameter to timerBegin() was in Hz? not MHz, now my two 7Segments light up and stay at 0.

You have to use the timer library. arduino-timer - Arduino Reference

Thank you, I tried it but it did not fix the issue. to note I am using ESP32, not arduino and if my information is correct the functions that I have used are built-in!

For ESP32, the following links may help:

1Hz would trigger the timer once every second.
Is that what you wanted?

Yes! I want it to increase the count by 1 each second, however I dont think the code I've written reaches the TMRISR() part that I have made for some reason.

I'm using the Arduino ESP32 board package version 2.0.13 and your code does not compile in my IDE.
You must be using version 3.n.n or higher but your code seems to be a mixture of version 2 and version 3 code.

Make these changes:

//
// ** Put these statements in setup():

// Set timer frequency to 1Mhz
myTimer = timerBegin(1000000);

// Attach timerISR function to the timer.
timerAttachInterrupt(myTimer, &timerISR);

// Set alarm to call ISRTMR function every second (value in microseconds).
// Repeat the alarm (third parameter) with unlimited count = 0 (fourth parameter).
timerAlarm(myTimer, 1000000, true, 0);

// ** Change ISR to this:
// Interrupt Service Routine (ISR)
void ARDUINO_ISR_ATTR timerISR() {
  i++;
  if (i > 99) {
    i = 0;
  }
}