Time-dependent mechanical characterization of nanowires is critical to understand their long-term reliability in applications, such as flexible-electronics and touch screens. It is also of great importance to develop a theoretical framework for experimentation and analysis on the mechanics of nanowires under time-dependent loading conditions, such as stress-relaxation and fatigue. Here, we combine in situ scanning electron microscope (SEM)/transmission electron microscope (TEM) tests with atomistic and phase-field simulations to understand the deformation mechanisms of single crystal silver nanowires held under constant strain. We observe that the nanowires initially undergo stress-relaxation, where the stress reduces with time and saturates after some time period. The stress-relaxation process occurs due to the formation of few dislocations and stacking faults. Remarkably, after a few hours the nanowires rupture suddenly. The reason for this abrupt failure of the nanowire was identified as stress-assisted diffusion, using phase-field simulations. Under a large applied strain, diffusion leads to the amplification of nanowire surface perturbation at long wavelengths and the nanowire fails at the stress-concentrated thin cross-sectional regions. An analytical analysis on the competition between the elastic energy and the surface energy predicts a longer time to failure for thicker nanowires than thinner ones, consistent with our experimental observations. The measured time to failure of nanowires under cyclic loading conditions can also be explained in terms of this mechanism.