We have performed time-dependent density-functional theory calculations to simulate the transient electrical response of a carbon nanotube-based electronic device. Time-dependent current density and electrostatic potential distribution are calculated and analyzed. Strong local vortices are observed for the current. In addition, the calculated dynamic admittance confirms that the dynamic response of the two-terminal device can be mapped onto the equivalent electric circuit reported in our previous work [Yam et al. Nanotechnology 2008, 19, 495203].