A new quartz crystal microbalance (QCM) with high time resolution was developed to study photoinduced variation of viscolastic properties in polymeric films. We present a full characterization of the mechanical properties (elasticity and viscosity) of the film deposited on the electrode, measuring both the frequency shift and the quality factor Q of the resonator in real time, with millisecond time resolution. This allows us to monitor the fast dynamics of mechanical properties and we present a study of the variation of viscoelastic properties under illumination in an azobenzene side-chain poly-meta-acrylate. Materials of this family are interesting because both optical and mechanical properties can be externally controlled by illumination, with the possibility to induced photo-triggered isothermal phase transitions and optical quenching.