Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String requestJson = "jsondata";
- String url = "http://gooddata.com:4055/test?action=search";
- for (int i = 1; i <= 100; i++) {
- long start = System.currentTimeMillis();
- CompletableFuture<HttpResponse> resp =
- HttpAsyncClientUtils.getInstance().sendPost(2000, url, proxy, requestJson);
- HttpResponse response = null;
- try {
- response = resp.get();
- if (response != null) {
- }
- }catch (Exception ex) {
- System.out.println("timeout exception.." + ex.getMessage());
- }finally {
- if (response != null) {
- EntityUtils.consumeQuietly(response.getEntity());
- }
- }
- long end = System.currentTimeMillis();
- System.out.println(end - start);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement