Conductance of inhomogeneous systems: Real-time dynamics