We developed a numerical method for computing the effective properties of a microstructure. The method is particularly efficient and accurate for microstructures with a diffuse interface description such as those generated from phase-field simulations. In particular, we considered the diffusive transport property of a microstructure by solving the steady-state diffusion equation using a Fourier-Chebyshev spectral method. We showed that even with a sharp-interface description, the results obtained using the method agree very well with existing analytical solutions and computer simulations for a number of simple model systems. Combining with the phase-field model for simulating microstructure evolution, the proposed method can be applied for modeling the temporal evolution of effective properties. This is illustrated by considering grain growth and the corresponding transport property as function of time.