Understanding AC Phase Control Code

ATmega328 Timers and Registers ar too much for my shrunken brain so when I saw code relating too AC Phase Control in the playground I found I needed a bit more help.

/*
  SimplerACPhaseControl.pde
  By Jonas Ekstrand 2017-04-09

*/
#include <TimerOne.h>
// FOUND THAT USING TRIAL AND ERROR GIVES ME THE BEST VALUES..
#define DIM_MAX_MICROS 9800
#define BRIGHT_MAX_MICROS 5128//3400
#define FULL_ON_MARGIN_MICROS 50
#define INTERRUPT 1
#define AC_PIN 4
int offTime = DIM_MAX_MICROS;
String inputString = "";
boolean stringComplete = false;

void setup() {
  inputString.reserve(100);
  Serial.begin(9600);
  pinMode(AC_PIN, OUTPUT);    // Set the Triac pin as output
  attachInterrupt(INTERRUPT, zero_cross_detect, RISING);
  Timer1.initialize(DIM_MAX_MICROS);
  Timer1.disablePwm(9);
  Timer1.disablePwm(10);
}

void loop() {    // Non time sensitive tasks - ie. read the serial port
  if (stringComplete) {
    Serial.print("dimming to:");
    Serial.println(inputString);
    offTime = map(inputString.toInt(), 0, 100, DIM_MAX_MICROS, BRIGHT_MAX_MICROS);
    // clear the string:
    inputString = "";
    stringComplete = false;
  }
}



void serialEvent() {
  //Excpecting 0-100 from the input to end with new line
  while (Serial.available()) {
    char inChar = (char)Serial.read();
    inputString += inChar;
    if (inChar == '\n') {
      stringComplete = true;
    }
  }
}

void zero_cross_detect() {
  Timer1.restart(); // sync with zero cross detect
  Timer1.attachInterrupt(nowIsTheTime, offTime);
}

void nowIsTheTime() {
  if (offTime < DIM_MAX_MICROS) // FULL OFF?
    digitalWrite(AC_PIN, HIGH);
  if (offTime > (BRIGHT_MAX_MICROS + FULL_ON_MARGIN_MICROS)) // FULL ON?
    digitalWrite(AC_PIN, LOW);
}

This code is simpler than most - much simpler than the code it shares the page with. Even so I need a few things explaining.

I want to control a fan with the reading from a Dallas temperature sensor. I guess that variable would be applied to the nowIsTheTime function but I don’t understand how the offTime variable in the loop function is calculated using map. Can someone explain in simple terms please.

The Arduino map() function is explained quite clearly in the reference section.

Yes of course but what does inputString.toInt() mean?

https://www.arduino.cc/en/Reference/StringToInt