As explained here: https://tex.stackexchange.com/a/88939/231952, it is not a good idea to use vertical rules in tables. In any case, to answer your question, these commands will suffice:
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}
Table 1. With booktabs
and without vertical rules (best choice):
\begin{tabular}{cc} \toprule
A & 0.002s \\
B & 0.05s \\
C & \\ \bottomrule
\end{tabular}
Table 2. Without booktabs
(i.e. with standard rules):
\begin{tabular}{|c|c|} \hline
A & 0.002s \\
B & 0.05s \\
C & \\ \hline
\end{tabular}
Table 3. With vertical rules and booktabs
:
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}
\begin{tabular}{|c|c|} \toprule
A & 0.002s \\
B & 0.05s \\
C & \\ \bottomrule
\end{tabular}
