question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Include benchmark extension

See original GitHub issue

My JUnit 5 demo contains a benchmark extension that very naively uses System.currentTimeMillis() to report a test’s wall clock time. Use:

@Test
@Benchmark
void benchmarked() throws InterruptedException {
	Thread.sleep(100);
	assertTrue(true);
}

Output:

timestamp = 2018-07-28T09:53:39.128030, Benchmark = Test 'benchmarked()' took 101 ms.
timestamp = 2018-07-28T09:53:39.136931, Benchmark = Test container 'BenchmarkTest' took 152 ms

I think this is worthy for inclusion in JUnit Pioneer. Thoughts?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
fduminycommented, Aug 14, 2018

Maybe you should use java.time.Clock and its subclasses (I also found one from junit5 : org.junit.platform.console.tasks.IncrementingClock) or Guava’s Stopwatch and Ticker

0reactions
nipafxcommented, Apr 13, 2021

To not have this issue open forever, we decided to close it. If other performance-related extensions show up, we can always reopen it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Benchmarking Extension - The Chromium Projects
The Chromium Benchmarking Extension is a quick-and-dirty way to test page load time performance within Chrome. Features. Can clear the cache between each...
Read more >
Benchmark in EF Extensions (EFE)
Learn Benchmark using EntityFramework Extensions by documentation & example. ... Forget to JIT compile the library; Include method not related to the test ......
Read more >
Benchmark Extension Activities Teaching Resources | TPT
Browse benchmark extension activities resources on Teachers Pay Teachers, ... Also included in: Benchmark Advance First Grade.
Read more >
RockiRider/BenchIt: VSCode Extension for Micro-Benchmarking
BenchMe README for Visual Studio Code. A micro-benchmarking tool for developers with Live Programming aspects. Only supports JavaScript for now.
Read more >
Benchmarks - Storage Performance Council
The SPC-1C/E benchmark extension for storage components creates the first industry-standard storage benchmark that includes measurement and reporting of energy ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found