I'm sorry to hear about your dog. Lactulose should be into the intestines within the hour after giving it. However, what it does is draws more water into the intestines for softening the stool as well as helps to lubricate what's in there to make it pass a bit more quickly. Depending on how hard the stool is in there will depend how long it takes for your dog to defecate with a normal consistency stool. It could be 2 hours after taking, it may take a couple of days! If you feel your dog is extremely uncomfortable due to the constipation, you may want to call your vet and see if the amount of lactulose should be increased until he passes stool at least one or two times, or you may need your vet to consider either an enema to start off with or a drug called cisapride which helps the intestines contract, and if often used in conjunction with lactulose to help constipated animals, especially those that become chronically constipated. You can also give some food supplements like cottage cheese, bran, or regular canned pumpkin with the feedings to help get the stool softened and moving out quicker.
Best of luck! Let me know if I can help further.