Partner – Moderne – NPI EA (cat=Spring Boot)
announcement - icon

Refactor Java code safely — and automatically — with OpenRewrite.

Refactoring big codebases by hand is slow, risky, and easy to put off. That’s where OpenRewrite comes in. The open-source framework for large-scale, automated code transformations helps teams modernize safely and consistently.

Each month, the creators and maintainers of OpenRewrite at Moderne run live, hands-on training sessions — one for newcomers and one for experienced users. You’ll see how recipes work, how to apply them across projects, and how to modernize code with confidence.

Join the next session, bring your questions, and learn how to automate the kind of work that usually eats your sprint time.

Course – Black Friday 2026 – NPI EA – main – before_post_content
announcement - icon

Yes, we're now running our Black Friday Sale. All Courses are 33% off until 1st December, 2026 at 17:00 Romania time:

>> EXPLORE ACCESS NOW

Course – Black Friday 2026 – NPI – main – before_post_content
announcement - icon

Yes, we're now running our Black Friday Sale. All Courses are 33% off until 1st December, 2026 at 17:00 Romania time:

>> EXPLORE ACCESS NOW

1. Overview

Performance testing is a crucial part of software development. It helps reveal bottlenecks and bugs and ensures our applications are responsive. One particularly important aspect is the time a web application needs to load and react to user interactions.

In this article, we’re going to explore two metrics that can help detect and improve load time issues: latency and load time. We’ll learn how these metrics are defined, what distinguishes them from each other, and how to measure them with the performance tool JMeter.

2. Latency and Load Time Metrics in JMeter

In JMeter, latency and load time are both metrics that measure roundtrips. In other words, they both measure the time from when a client sends a request to a server until it receives the response. However, there’s an important difference between these two.

Latency is defined as the time from just before sending the request to just after receiving the first part of the response, whereas load time is the time from just before sending the request to just after receiving the last part of the response.

For both metrics, JMeter includes the time it takes to assemble the request. Latency also includes the time it takes to assemble the first part of the response, and load time includes the time to assemble the entire response. Assembling does not include the rendering of the response or any client-side code execution.

3. How to Measure Latency and Load Time

We can measure latency and load time in JMeter by creating a test plan that sends an HTTP request and uses a View Results Tree Listener.

We’ll start with a test plan that JMeter automatically creates when we open the tool. In our case, let’s rename it to LatencyVsLoadTime:

Screenshot of a JMeter test plan

Next, let’s create a Thread Group, which is the beginning point of every test plan. This is done by right-clicking the test plan and then selecting Add -> Thread (Users) -> Thread Group:

JMeter screenshot on how to create a Thread Group

Next, let’s add an HTTP Request by right-clicking the Thread Group and selecting Add -> Sampler -> HTTP Request:

JMeter screenshot on how to create an http request sampler

Last but not least, we need a Listener that tracks the results of our request. Let’s add it by right-clicking the Thread Group and selecting Add -> Listener -> View Results Tree:

JMeter screenshot on how to create a View Results Tree Listener

Now that we have all parts of the test plan in place, let’s configure our HTTP request.

To do this, we select the HTTP Request and set the Path to the URL we want to test. For our example, let’s choose https://www.google.com:

JMeter screenshot on how to configure an http request

After saving the test plan by clicking the disk icon in the top bar, we can execute it. Let’s select the HTTP Request and click the play button in the top bar:

JMeter screenshot on how to save a test plan

Finally, let’s check the results by selecting the View Results Tree element under the Sampler result tab. In our example, the request has a latency of 215 ms and a load time of 218 ms:

Screenshot of JMeter test results of an http request

4. Conclusion

In this article, we’ve discussed two performance metrics, latency and load time, that can help to detect load time issues and improve the usability of an application.

First, we defined the metrics in the context of JMeter and elaborated on the difference between the two. Then, we saw how to set up a JMeter test plan with an HTTP request that we could use to measure the metrics. Finally, we learned how to execute the test plan and examine the results.

The code backing this article is available on GitHub. Once you're logged in as a Baeldung Pro Member, start learning and coding on the project.
Partner – Moderne – NPI EA (tag=Refactoring)
announcement - icon

Modern Java teams move fast — but codebases don’t always keep up. Frameworks change, dependencies drift, and tech debt builds until it starts to drag on delivery. OpenRewrite was built to fix that: an open-source refactoring engine that automates repetitive code changes while keeping developer intent intact.

The monthly training series, led by the creators and maintainers of OpenRewrite at Moderne, walks through real-world migrations and modernization patterns. Whether you’re new to recipes or ready to write your own, you’ll learn practical ways to refactor safely and at scale.

If you’ve ever wished refactoring felt as natural — and as fast — as writing code, this is a good place to start.

Course – Black Friday 2026 – NPI EA – main – after_post_content

announcement - icon

Yes, we're now running our Black Friday Sale. All Courses are 33% off until 1st December, 2026 at 17:00 Romania time:

>> EXPLORE ACCESS NOW

Course – Black Friday 2026 – NPI – main – after_post_content

announcement - icon

Yes, we're now running our Black Friday Sale. All Courses are 33% off until 1st December, 2026 at 17:00 Romania time:

>> EXPLORE ACCESS NOW