Exemplo n.º 1
0
  static void one_concurrent() {
    TimePartitions time_partitions;
    time_partitions.report_gc_phase_start("ConcurrentPhase", 2, GCPhase::ConcurrentPhaseType);
    time_partitions.report_gc_phase_end(8, GCPhase::ConcurrentPhaseType);

    TimePartitionPhasesIterator iter(&time_partitions);

    validate_gc_phase(iter.next(), 0, "ConcurrentPhase", 2, 8);
    // ConcurrentPhaseType should not affect to both 'sum_of_pauses()' and 'longest_pause()'.
    assert(time_partitions.sum_of_pauses() == Tickspan(), "Incorrect");
    assert(time_partitions.longest_pause() == Tickspan(), "Incorrect");

    assert(!iter.has_next(), "Too many elements");
  }
Exemplo n.º 2
0
void TimePartitions::clear() {
  _phases->clear();
  _active_phases.clear();
  _sum_of_pauses = Tickspan();
  _longest_pause = Tickspan();
}
Exemplo n.º 3
0
inline Tickspan operator-(const Ticks& end, const Ticks& start) {
  return Tickspan(end, start);
}