  The prompt optical emission contemporaneous with the $\gamma$-rays from
$\gamma$-ray bursts (GRBs) carries important information on the central engine
and explosion mechanism. We study the time lag between prompt optical emission
and $\gamma$-rays in GRB 990123 and GRB 041219a, which are the only two GRBs
had been detected at optical wavelengths during the ascending burst phase.
Assuming profiles of prompt optical light curves are the same as the prompt
$\gamma$-rays, we simulate optical light curves with different time lags and
compare them with the observed optical flux. Then the best fit time lag and its
error are determined by chi-squared values. We find that time lags between
prompt optical emission and $\gamma$-rays in GRB host galaxy rest-frames are
consistent in the two GRBs, which is $5\sim7$ s for GRB 990123 and $1\sim5$ s
for GRB 041219a. This result is consistent with a common origin of prompt
optical and $\gamma$-ray emissions in the two GRBs. Based on synchrotron
cooling model, we also derive the parameters for the two GRBs.
