Income tax expense (benefit). We recorded an income tax benefit of $1.5 million for the three months ended September 30, 2022, compared to a tax benefit of $0.2 million for the three months ended October 1, 2021. The increase in the tax benefit is primarily attributable to the loss before income tax combined with various tax deductions and tax credits.
Net income (loss). Our net income was $0.1 million for the three months ended September 30, 2022, as compared to a net income of $0.8 million for the three months ended October 1, 2021. The decrease in net income was primarily attributable to the decrease in gross profit combined with higher G&A, offset by higher income tax benefit.
Nine Months Ended September 30, 2022 Compared to Nine Months Ended October 1, 2021
Contract revenue. Consolidated contract revenue increased $54.3 million, or 20.8%, in the nine months ended September 30, 2022, compared to the nine months ended October 1, 2021, primarily due to incremental revenues in our Energy segment generated from new governmental construction-management and design-build projects, combined with incremental revenues from the resumption of projects that had been suspended in fiscal 2021 due to Covid-19, and increased governmental revenues in our Engineering and Consulting segment, partially offset by software licensing sales that occurred in the third quarter of fiscal year 2021 that did not recur in the same period for 2022.
Contract revenue in our Energy segment increased $52.2 million, or 24.9%, in the nine months ended September 30, 2022, compared to the nine months ended October 1, 2021, primarily as a result of incremental revenues from new governmental construction-management and design-build projects, combined with incremental revenues from the resumption of projects that had been suspended in fiscal 2021 due to Covid-19, partially offset by software licensing sales that occurred in the third quarter of fiscal year 2021 that did not recur in the same period for 2022.
Contract revenue in our Engineering and Consulting segment increased $2.1 million, or 4.1%, in the nine months ended September 30, 2022, compared to the nine months ended October 1, 2021, primarily due to increased services provided to our governmental clients.
Direct costs of contract revenue. Direct costs of consolidated contract revenue increased $55.0 million, or 34.3%, in the nine months ended September 30, 2022, compared to the nine months ended October 1, 2021, primarily due to increases in our contract revenues in our Energy segment as described above as well as the ramping up of new projects for which we saw higher project startup costs relative to the revenue recognized.
Direct costs of contract revenue in our Energy segment increased $55.9 million, or 41.7%, in the nine months ended September 30, 2022, compared to the nine months ended October 1, 2021. Direct costs of contract revenue for the Engineering and Consulting segment decreased $0.9 million, or 3.4%, in the nine months ended September 30, 2022, compared to the nine months ended October 1, 2021.
Subcontractor services and other direct costs increased by $42.0 million, or 37.6%, and salaries and wages increased by $13.0 million, or 26.7%, in the nine months ended September 30, 2022, compared to the nine months ended October 1, 2021, primarily due to the increases in contract revenues as described above combined with changes in the mix of those contract revenues to those which contain a higher percentage of material costs and installation subcontracting and lower percentage of labor costs, as well as the ramping up of new projects for which we saw higher project startup costs relative to the revenue recognized.
Gross Profit. Gross profit decreased 0.7% to $100.5 million, or 31.8% gross margin, for the nine months ended September 30, 2022, compared to gross profit of $101.1 million, or 38.7% gross margin, for the nine months ended October 1, 2021. The decrease in gross margin was primarily driven by changes in the mix of revenues as described above, combined with a reduction in software licensing revenues and the ramping up of new projects for which we saw higher project startup costs relative to the revenue recognized.