How long does it take for a vaccine to "work"?

If I get vaccinated against anthrax, the flu, smallpox, or whatever, how long after the vaccine is introduced into the body am I “vaccinated”? How long before I am safe from the disease?
If I get a smallpox shot at 12pm on Monday when can I consider myself safe from smallpox? Later that day? Next week? Immediately?

And whats the most painful vaccination? I know typhoid hurt BAD.

For flu, protection starts to kick in about 2 weeks but isn’t up to its max. protection for 4 weeks or so.

Smallpox vaccine protects against exposures up to 3 days BEFORE the vaccination. Rabies vaccine also protects against exposures that occur before the vaccine is given. Anthrax takes forever because it requires a whole series of shots spaced weeks apart. The answer to your question is, “It depends on the vaccine.” But I’d say that in general, your can figure that your immunity peaks about 2-4 weeks after the shot.

Hepatitis C vaccine is also given in series, so don’t expect peak protection until after the last one is given. Aside: Is there such thing as Hep C booster shots, like those of tetanus?

Rabies 21 shots vaccination program was probably the most painful, but the series have known been reduced, so perhaps it is less painful.