Calculation of the traversal time in resonant tunneling devices