code: function registerTiming(name, startEnd, timestamp) {
          if (!timestamp) {
              timestamp = this.performanceInstance.now();
          }
          let timestamps = this.timestamps[name];
          if (!timestamps) {
              timestamps = this.timestamps[name] = [];
          }
          let t;
          const l = timestamps.length;
          for (let i = l-1; i >=0; i--) {
              t = timestamps[i];
              if (t && !t[startEnd]) break;
              t = null;
          }
          if (!t) {
              t = {};
              timestamps.push(t);
          }
          t[startEnd] = timestamp;
      }
docs: Registers start/end timing of some event.
  @this {vivliostyle.profile.Profiler}
  @param {string} name Name of event
  @param {string} startEnd Either of "start" or "end"
  @param {number=} timestamp Used as the actual timestamp of the event if specified, instead of "now"