If you have a devil of a time, you have a very difficult time. Example: Before she divorced, Ann had had a devil of a time with my her husband.