No, laws are not a waste of time using this logic. Laws against murder aren't meant as a way of preventing it, they are meant to be used for prosecuting and punishing murders. People who murder are not rational people, so the laws against it don't stop them, they will murder anyways, and the only way to stop individual murder requires a weapon, which some people want to outlaw, so people who want to defend themselves can't have legal access to firearms, and murders, who obviously don't care about the law, will still get them.