A novel method to fabricate Magnesium diboride ( MgB2) film by electron beam annealing was presented. The MgB2 thin films could be prepared in a second or sub-second without any toxic diborane gas, extra Mg vapor or argon gas. The method has the advantages of short formation time and high efficiency. Based on this, the relationship between MgB2 conductivity and electron beam annealing duration was investigated experimentally with an accelerating voltage of 40 × 103 V, a beam current of 3×103 A and different annealing durations of 0.1796s, 1860s, 0.2108s, 0.2200s and 0.2332s. The experimental results showed the MgB2 film with 0.2200s has the highest Tconset , the most dense structure and the strongest diamagnetic signal. Its zero-field Jc at 5 K was 5.0 × 106 A/cm2. Also the variation of the film superconducting properties with the annealing duration was found, it will provide an important reference for the preparation of high-quality MgB2 thin films.