An analytic solution to the problem on transient processes in a two-barrier nanostructure is found. Explicit expressions are obtained for a transient current produced by an instantly applied weak electric field. The current relaxes to a stationary state for a time ħ/Γ (Γ is the width of a resonance level), oscillating at a frequency of ξ = ɛ − ɛR, where ɛ is the energy of electrons coming from an emitter and ɛR is the resonance level energy. The transient current for interacting electrons is found in the quasi-classical approximation. It is shown that interaction between electrons can drastically change the transient current, especially in the presence of hysteresis of the current-voltage characteristic (CVC). Near extreme CVC values in the region of negative differential conductivity, the oscillation frequency tends to zero and becomes imaginary, compensating the decay. Thus, the transient current relaxes with very large times without oscillations. In contrast, in the case of positive differential conductivity, the oscillation frequency becomes very high, while the relaxation time remains the same, 1/Γ.