using typecasting to calculate megabytes per a second