I am trying to test the performance (in terms of runtime) for my web browser, but I am having trouble choosing due to multithreading.
My main class:
class WebCrawlerTest {
Class AllWebsiteProcessorTest:
class AllWebsiteProcessorTest implements Runnable{
With another class (with the main method) I create an instance of WebCrawlerTest and then pass in an array of websites. The scanner works fine, but I can’t figure out how to do this.
I can get the start time ( System.getCurrentTime...(); ), but the problem is the end time. I tried adding end time as follows:
//another class public static void main(.....){ long start = getCurrent....(); WebCrawlerTest w = new WebCrawlerTest(listOfSites, true); long end = getCurrent....(); }
What does not work. I also tried adding end after executor.shutdown() , which again does not work (instantly starts). How to capture time for the final completed stream ?
source share