Messenger of Allah ﷺ said, "If I stayed in prison as long as Joseph stayed and then the messenger came, I would respond to his call (to go out of the prison) ."
قَالَ رَسُولُ اللَّهِ ﷺ لَوْ لَبِثْتُ فِي السِّجْنِ مَا لَبِثَ يُوسُفُ ثُمَّ أَتَانِي الدَّاعِي لأَجَبْتُهُ