package util
- Alphabetic
- By Inheritance
- util
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
trait
Counting extends Locking
A simple class that enables the counting of something.
A simple class that enables the counting of something.
Examples:
- How often is a function called during runtime?
- How often runs the program in a specific case?
Thread Safety
This class is thread safe.
-
class
InMemoryClassLoader extends ClassLoader
A simple
ClassLoader
that looks-up the available classes in a standard map. - class IntStatistics extends Counting
-
final
class
Milliseconds extends AnyVal with Serializable
Represents a time span of
n
milliseconds. -
final
class
Nanoseconds extends AnyVal with Serializable
Represents a time span of
n
nanoseconds. -
class
PerformanceEvaluation extends Locking
Measures the execution time of some code.
Measures the execution time of some code.
Thread Safety
This class is thread safe.
-
final
class
Seconds extends AnyVal with Serializable
Represents a time span of
n
seconds.
Value Members
- final val AnyToAnyThis: (Any) ⇒ Any
- val ScalaMajorVersion: String
-
def
asMB(bytesCount: Long): String
Converts the specified number of bytes into the corresponding number of megabytes and returns a textual representation.
- def avg(ts: Traversable[Nanoseconds]): Nanoseconds
-
final
def
gc(memoryMXBean: MemoryMXBean = ManagementFactory.getMemoryMXBean, maxGCTime: Milliseconds = new Milliseconds(333))(implicit logContext: Option[LogContext] = None): Unit
Tries its best to run the garbage collector and to wait until all objects are also finalized.
-
final
def
ns2ms(nanoseconds: Long): Double
Converts the specified number of nanoseconds into milliseconds.
- def renderConfig(config: Config, withComments: Boolean = true): String
- object GlobalPerformanceEvaluation extends PerformanceEvaluation
-
object
Milliseconds extends Serializable
Defines factory methods and constants related to time spans in Milliseconds.
-
object
Nanoseconds extends Serializable
Defines factory methods and constants related to time spans in Nanoseconds.
-
object
PerformanceEvaluation
Collection of helper functions useful when evaluating the performance of some code.
Collection of helper functions useful when evaluating the performance of some code.
Measuring the time and memory used by some piece of code:
import org.opalj.util.PerformanceEvaluation.{memory,time} var store : Array[Object] = null implicit val logContext = Some(org.opalj.log.GlobalLogContext) for(i <- 1 to 5){ memory{store = null}(l => println("empty: "+l)) memory{ time{ store = Array.fill(1000000){val l : Object = List(i); l} }(t => println("time:"+t.toSeconds)) }(l => println("non-empty:"+l)) }
Example: -
object
Seconds extends Serializable
Common constants related to seconds.