Skip to content

coding-guy/Java-SimpleStopWatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Java-SimpleStopWatch

Really Simple Class to measure the time a process takes

How to use

You have nothing to da as create an object of class StopWatch to use it. After that you can use the methods

start( String name ) and

stop()

If you want to use a logger, ypu have provide an instance of Logger to StopWatch by using the method

setLogger( Logger logger )

Requirements

The class will going to include slf4j logger. Make sure it is available in your classpath.

Example

StopWatch watch = new StopWatch( "Timer" );
watch.start( "sending post request" );
postRequest( entity );
watch.stop();

Which prints out the following to STDOUT, because no logger is supplied:

[Timer][sending post request] has took 87 ms

About

Really Simple Class to measure the time a process takes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages