The speed of gravitational waves for a single observation can be measured by the time delay among gravitational-wave detectors with Bayesian inference. Then multiple measurements can be combined to produce a more accurate result. From the near simultaneous detection of gravitational waves and gamma rays originating from GW170817/GRB 170817A, the speed of gravitational wave signal was found to be the same as the the speed of the gamma rays to approximately one part in $10^{15}$. Here we present a different method of measuring the speed of gravitational waves, not based on an associated electromagnetic signal but instead by the measured transit time across a geographically separated network of detectors. While this method is far less precise, it provides an independent measurement of the speed of gravitational waves. For GW170817 a binary neutron star inspiral observed by Advanced LIGO and Advanced Virgo, by fixing sky localization of the source at the electromagnetic counterpart the speed of gravitational waves is constrained to 90% confidence interval (0.97c, 1.02c), where c is the speed of light in a vacuum. By combing seven BBH events and the BNS event from the second observing run of Advanced LIGO and Advanced Virgo, the 90% confidence interval is narrowed down to (0.97c, 1.01c). The accurate measurement of the speed of gravitational waves allows us to test the general theory of relativity. We further interpret these results within the test framework provided by the gravitational Standard-Model Extension (SME). In doing so, we obtain simultaneous constraints on 4 of the 9 nonbirefringent, nondispersive coefficients for Lorentz violation in the gravity sector of the SME and place limits on the anisotropy of the speed of gravity.