I didn't realize how old this thread is before I started working on a solution. In any case, it's already done, so here it is anyway.
I believe this should do what you wanted, but do note that I whipped it up in a couple of hours, so it's definitely not perfect.
PS: The "csv" file is saved right next to the executable.
Ping with latency alarm?