Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9126773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:07:14+00:00 2026-06-17T07:07:14+00:00

In my app do I multiple request to an external server like this: req

  • 0

In my app do I multiple request to an external server like this:

    req = Curl::Easy.new do |curl| 
        curl.url = "https://www.mysite.com"
        curl.headers['Content-type'] = 'application/json'
    end
    req.perform

It is possible to retrieve the response time (how long takes the request)?

A solution that I think is working is the following (pseudocode), but there is something more elegant?

    req = Curl::Easy.new do |curl| 
        curl.url = "https://www.mysite.com"
        curl.headers['Content-type'] = 'application/json'
    end

    timeBefore = Time.now
    req.perform
    timeAfter = Time.now
    responseTime = timeAfter - timeBefore
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:07:16+00:00Added an answer on June 17, 2026 at 7:07 am

    You can use Ruby’s Benchmark module as follows:

    time = Benchmark.realtime do
          req.perform
    end
    puts "Time elapsed #{time*1000} milliseconds"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create an app that multiple users would log into a server
We're developing this ASP.NET web app with multiple users on different browsers. One of
I would like to make a single Android app for multiple Android versions (possibly
I am using this code: def req(url, postfields): proxy_support = urllib2.ProxyHandler({http : 127.0.0.1:8118}) opener
So for my Android app I need a centralized server so multiple phones can
I am trying to send app request notification to multiple friends using Graph api,,here
I'm working on an iPhone app that makes a multipart HTTP request with multiple
I'm trying to use one app to satisfy multiple url paths. That is to
Scenario: My app has to make a request (AJAX) and based on request multiple
I'm relatively new to django.. In the app that I'm building, there are multiple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.