A physical model is developed to investigate the switching dynamics of programmable-metallization-cell (PMC) memory. Both "quasi-DC" and time-dependent transient characteristics of PMC are captured by this model in good agreement with the experimental data from Cu/SiO2 and Ag/Ge 0.3Se0.7 cells. For the first time, the time-dependent switching process of PMC is quantified, thus paving the way for a compact SPICE model for circuit simulation. This model reveals that experimentally measured switching parameters such as threshold voltage and cell resistance are dynamic quantities that depend on the programming pulse shape and not the pulse amplitude alone. Using this model, we show that the PMC has the potential to emulate the function of a biological synapse and exhibit the spike-timing-dependent plasticity (STDP) behavior for emerging neuromorphic computation system designs.