gra-m / DBServer

Database server project
0 stars 0 forks source link

Create REST test application #38

Closed gra-m closed 2 years ago

gra-m commented 2 years ago
    Thread searchTest = new Thread() {
            @Override
            public void run() {
            while(true)  {
                performSearchTest();
                try {
                    Thread.sleep(500);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
            }
        };

to


    Thread searchTest = new Thread(() -> {
        while(true)  {
            performSearchTest();
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
        });
gra-m commented 2 years ago

Alternate, but Runnable does not name thread, currentThread().getName() == main.

```

Runnable searchTest2 = ()-> { while(true) { performSearchTest(); try { Thread.sleep(500); } catch (InterruptedException e) { throw new RuntimeException(e); } } }; searchTest2.run();