How quickly can you erase bad karma?

In Christianity and Islam, it clearly says that god forgives all sin when you repent.

I was wondering how quickly negative karma is erased in Buddhism? If someone was to kill someone and then pray, would this bad karma be wiped away immediately?