In a bid to make at-home flu tests as cheap and easy as home pregnancy tests, the federal government said Wednesday that it had invested $24 million with two companies working on two entirely different approaches.

The hope is to speed up both treatment and tracking of the annual influenza epidemic, said the Biomedical Advanced Research and Development Authority, a division of the Health and Human Services Department.

“It would be amazing,” Rick Bright, director of the biomedical agency, told NBC News. “It would have a tremendous impact not only on seasonal flu outbreaks but on a pandemic.”

Right now, people who think they have influenza must get to a doctor, get tested, wait for the test results, and perhaps get flu medications. Flu drugs such as Tamiflu work best if people take them within the first 48 hours of infection, and people may wait too long to get to a doctor, the agency said in a statement.

Also, they are spreading flu germs as they move from home to clinic to pharmacy, Bright said.

With an at-home test, patients would never have to leave the house. Bright envisions a future in which people take the test, then use an app or a device to send the information to their doctor, who can prescribe medication that might be delivered to the home. “You would never leave the house,” Bright said.

“It would slow the spread of an epidemic or a pandemic,” he said.

“If health care providers and the government knew where the influenza hot spots were occurring around the country," he added, "we would know where to get medical supplies, where to target vaccines and drugs."

“We would have much faster information on that spreading virus than we currently have. Right now we are beholden to a system where sick people have to be sick enough to go to a doctor’s office.”

The weekly reports from the Centers for Disease Control and Prevention on the spread of seasonal flu are based on data that is usually at least a week old.

In addition, most people with influenza never see a doctor, so estimates of the spread of flu are imprecise.

“This would give us close to real-time information about the outbreak,” Bright said.

The two companies getting funded by are Cue Health and Diassess.

Cue Health will get $14 million to develop a flu test to add to its in-home health monitoring technology platform, Bright said.

Diassess is designing a test that more closely resembles a home pregnancy test, Bright said. “You use it once and throw it away,” he said. The biomedical agency is investing $10 million with Diassess, with the promise of more over five years if things work out.

For the tests to deliver on their full potential, they would have to be connected to both a physician’s office and federal databases. That tie-in is part of Cue’s platform. An app could be used with the Diassess test, Bright said. The carrot for the patient would be a quick prescription for Tamiflu or other treatment.

“We want to make sure people have access not only to the knowledge they have been infected, but access to the lifesaving drugs,” Bright said.

The tests would be cheaper than the current clinic and hospital flu tests, which include administrative and laboratory fees, Bright said. He said his agency would push to get health insurance companies to pay for the tests.

“We understand that just dropping a device into the house doesn’t change a lot,” he said. “We need to change the health care system.”

If these at-home flu tests work, Bright would like to try similar approaches to test for outbreaks of new diseases, such as Zika, or other spreading viruses.