File writing speed

Does anyone knows how Ruby can determine, knwoing the file size in MB,
the speed of a file writing? ie I need to know how seconds PC needs to
write a file in HD…

$ time ruby -e “a =‘yo’, ‘w’); 10_000_000_000; a.write

but I’m not sure if this is good enough…