Ping a server and report ping time on dashboard

hey guys,first thing first im a noobie in coding,i need a code so that my esp8266 connects to wifi and pings an ip and then shows the ping time on dashboard.can you help me?

use this library and see if you can get the ping time