Income tax expense (benefit). We recorded an income tax benefit of $0.2 million for the three months ended October 1, 2021 compared to a tax benefit of $1.6 million for the three months ended October 2, 2020. The decrease in the income tax benefit is primarily attributable to higher pre-tax income combined with decreases related to energy efficiency building deduction.
Net income (loss). Net income was $0.8 million for the three months ended October 1, 2021, as compared to a net income of $2.6 million for the three months ended October 2, 2020. The decrease in net income was primarily attributable to lower income tax benefit as described above.
Nine Months Ended October 1, 2021 Compared to Nine Months Ended October 2, 2020
Contract revenue. Consolidated contract revenue decreased $32.5 million, or 11.1%, in the nine months ended October 1, 2021 compared to the nine months ended October 2, 2020, primarily due to decreased contract revenues from our construction management activities in our Energy segment and the impact of having one fewer week in our first fiscal quarter of fiscal year 2021 as compared to our first fiscal quarter of fiscal year 2020. Contract revenue related to Energy segment construction management projects decreased as a result of the completion of a number of Energy segment projects and delays in the start-up of new Energy segment projects.
Contract revenue in our Energy segment decreased $32.4 million, or 13.4%, in the nine months ended October 1, 2021 compared to the nine months ended October 2, 2020. Contract revenue for the Energy segment primarily decreased as a result of decreased construction management activities in our Energy segment, as described above, and the impact of having one fewer week in our first fiscal quarter of fiscal year 2021 as compared to our first fiscal quarter of fiscal year 2020.
Contract revenue in our Engineering and Consulting segment was relatively flat for the nine months ended October 1, 2021 compared to the nine months ended October 2, 2020.
Direct costs of contract revenue. Direct costs of consolidated contract revenue decreased $38.8 million, or 19.5%, in the nine months ended October 1, 2021 compared to the nine months ended October 2, 2020, primarily as a result of decreased construction management activities in our Energy segment and the impact of having one fewer week in our first fiscal quarter of fiscal year 2021 as compared to our first fiscal quarter of fiscal year 2020.
Direct costs of contract revenue in our Energy segment decreased $37.0 million, or 21.6%, in the nine months ended October 1, 2021 compared to the nine months ended October 2, 2020, primarily as a result of the reasons described above. Direct costs of contract revenue for the Engineering and Consulting segment decreased $1.8 million, or 6.3%, in the nine months ended October 1, 2021 compared to the nine months ended October 2, 2020, primarily due to the impact of having one fewer week in our first fiscal quarter of fiscal year 2021 as compared to our first fiscal quarter of fiscal year 2020.
Subcontractor services and other direct costs decreased by $38.4 million, or 25.6%, for the nine months ended October 1, 2021 compared to the nine months ended October 2, 2020 primarily due to the decrease in construction management activities. Salaries and wages decreased by $0.4 million, or 0.7%, for the nine months ended October 1, 2021 compared to the nine months ended October 2, 2020 primarily as the increased utility revenue activities offset the construction management reductions.
As a percentage of contract revenue, salaries and wages increased to 18.6% of contract revenue for the nine months ended October 1, 2021 from 16.6% for the nine months ended October 2, 2020. Subcontractor services and other direct costs decreased to 42.8% of contract revenue for the nine months ended October 1, 2021 from 51.1% of contract revenue for the nine months ended October 2, 2020 for the reasons noted above.
Gross Profit. Gross profit increased 6.6% to $101.1 million, or 38.7% gross margin, for the nine months ended October 1, 2021 compared to $94.9 million, or a 32.3% gross margin for the nine months ended October 2, 2020. The increase in our gross margin was primary driven by changes in the mix of revenues to those which contain a higher percentage of direct labor costs combined with the reduction in pass-through construction management costs.