Find the answer to your Linux question:
Results 1 to 2 of 2
How can i get the time took to ping a server something like struct ping_result { min_time; avg_time; max_time; } struct ping_result result; ping( char * server , char *opt ...
  1. #1
    Just Joined!
    Join Date
    Jul 2008
    Posts
    22

    ping time

    How can i get the time took to ping a server

    something like
    struct ping_result
    {
    min_time;
    avg_time;
    max_time;
    }

    struct ping_result result;
    ping( char * server , char *opt , &result);

  2. #2
    Just Joined!
    Join Date
    Nov 2008
    Posts
    26
    One way would be to use the system() function to execute ping with a redirect to a file. (Don't forget that you'll need to tell ping how many attempts to make [man ping]). Then open the file, and read the results. Build your structure and do whatever with it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...