  We have developed an algorithm dedicated to timing reconstruction in highly
granular calorimeters (HGC). The performance of this algorithm is evaluated on
an electromagnetic calorimeter (ECAL) with geometries comparable to the
electromagnetic compartment (CE-E) of the CMS endcap calorimeter upgrade at
HL-LHC and conceptual Particle Flow oriented ECAL's for future Higgs factories.
The time response of individual channel is parameterized according to the CMS
experimental result. The particle Time-of-Flight (ToF) can be measured with a
resolution of $5\sim20 \;\rm{ps}$ for electromagnetic (EM) showers and $80\sim
160 \;\rm{ps}$ for hadronic showers above 1 GeV. The presented algorithm can
significantly improve the time resolution, compared to a simple averaging of
the fast component of the time spectrum. The effects of three detector
configurations are also quantified in this study. ToF resolution depends
linearly on the timing resolution of a single silicon sensor and improves
statistically with increasing incident particle energy. A clustering algorithm
that vetos isolated hits improves ToF resolution.
