public enum PrintFormat extends Enum<PrintFormat>
| Enum Constant and Description |
|---|
DETAILED
Generates a detailed view of each counter type and timing session available in the
stopwatch, one row for each timing session, and the total elapsed time for each type,
as well.
|
SUMMARIZED
Generates a summarized view which represents the total elapsed time for each counter
type available in the stopwatch, one row for each type.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkCompatibility(PrintStyle printStyle)
Checks if a given
PrintStyle is compatible with this PrintFormat. |
abstract String |
format(Stopwatch stopwatch,
PrintStyle style)
Generates a string with formatted stopwatch data and custom style.
|
static PrintFormat |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PrintFormat[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PrintFormat SUMMARIZED
Sample output (applying PrintStyle.SUMMARIZED_TABLE_FULL):
==================================== Counter Elapsed time ------------------------------------ Wall clock time 0:00:04.455383500 CPU time 0:00:00.109375000 User time 0:00:00.046875000 System time 0:00:00.062500000 ====================================
PrintStylepublic static final PrintFormat DETAILED
Sample output (applying PrintStyle.DETAILED_TABLE_FULL):
===============================================
# Elapsed time Elapsed time (+)
===============================================
Wall clock time
-----------------------------------------------
1 0:00:01.055824100 0:00:01.055824100
2 0:00:00.836569500 0:00:01.892393600
3 0:00:00.836091100 0:00:02.728484700
4 0:00:00.837092700 0:00:03.565577400
-----------------------------------------------
TOTAL 0:00:03.565577400
===============================================
CPU time
-----------------------------------------------
1 0:00:00.109375000 0:00:00.109375000
2 0:00:00.000000000 0:00:00.109375000
3 0:00:00.000000000 0:00:00.109375000
4 0:00:00.015625000 0:00:00.125000000
-----------------------------------------------
TOTAL 0:00:00.125000000
===============================================
PrintStylepublic static PrintFormat[] values()
for (PrintFormat c : PrintFormat.values()) System.out.println(c);
public static PrintFormat valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic abstract String format(Stopwatch stopwatch, PrintStyle style)
stopwatch - the stopwatch to be printedstyle - the PrintStyle to be appliedIllegalArgumentException - if the specified PrintStyle is not compatible with
this PrintFormat.public void checkCompatibility(PrintStyle printStyle)
PrintStyle is compatible with this PrintFormat.printStyle - the PrintStyle to be checked, not nullNullPointerException - if the PrintStyle is nullIllegalArgumentException - if the PrintStyle is not compatibleCopyright © 2021. All rights reserved.