In this paper, single-machine scheduling with carbon emission index is studied. The objective function is to minimize the sum of total flow time and carbon emission. Firstly, the problem is shown to be NP-hard by Turing reduction. Then mathematical programming (MP) model is established. A pseudo-time algorithm based on dynamic programming (DPA) is proposed for small scale. And a Bird Swarm Algorithm (BSA) is proposed to compete with DPA. In addition, simulation experiments are used to compare the proposed algorithms. DPA is shown to be more efficient for small scale problem, and BSA is better for large scale problem.