John Walker had himself a marvelous time in the first track meet he had entered in almost a year Saturday night at the Muhammad Ali Invitational. The fastest time in the world in fact: 3:37.4 in a memorable 1.500-meter race.

But Walker, the 26-year-old Olympic 1,500-meter champion and world record holder in the mile, also remembers many agonizing months over the last two years, when a painful leg injury required back-to-back operations last February and April and made him wonder if he ever would regain world-class form.

"I thik most athletes would have given up," Walker said after his Ali victory. "If you could understand my frustration the last two years, to have to walk home from training, to have to ring up and say, 'come get me, I've misjudged my distance and I can't make it back home.'

"I've had my own pressure. People were writing me off and saying I'd never run again. Even my own countrymen (in New Zealand) were saying 'it's over.' I had doubts I would ever beat four minutes for the mile again."

He had doubts until Saturday night, when he shattered the old record of 3:37.8 set by West Germany's Harald Norpoth in 1971, defeating Paul Cummings with a potent kick coming off the last turn 30 meters from the finish.

The record probably will not be accepted as an official world mark because the track used in the Ali meet has no curb. But Walker was terribly pleased with the clocking.

His time, Walker said, was the equivalent of a 3:65 mile, "and I believe I can go faster, oh, definitely," he said.

But not much longer, in preparation.

Walker can run now for only 3 minutes at a time during his training sessions. "If I run any longer, my leg ceases to function, I can't move and the pain is unbearable," he said. "But I've learned to adapt and make good use of the time."

Walker's problem is centered on an artery that runs down the calf of his right leg. If he runs too long, the calf muscle expands and cuts off the flow of blood. The operations were designed to relieve that pressure, but he says they were not totally successful and he may have to undergo even more surgery.

Still, Walker flew off to New Zealand today a happy man.

"My biggest concern going into the race was my confidence," he said. "I wasn't thinking about being hurt at all. I wash't worried about running, it was how to run. I was so scared of not making the right move, not kicking at the proper time. But as it turned out, it was the perfect race for me."

Still, Walker said later on, the 1,500 may not be the race he aims for at the 1980 Olympics. He said he was seriously considering stepping up to 5,000 meters "because a good 1,500 meter man has to move up. There's too many good guys coming up."

There were an awful lot of good guys running the 60-meter hurdles at the Ali meet, and the best of them all was Renaldo (Skeets) Nehemiah, the 19-year-old University of Maryland sophomore considered by many to be the best hurdler in the world.

Nehemiah posted an impressive victory against a strong field Saturday night, with a hand-timed clocking of 7.5 seconds. "Last year I ran 7.5 at my peak so I'm way ahead of myself already," Nehemiah said.

"I don't believe that other people are faster than I am; it's just a matter of whether I run my best or not. It's harder to stay on top than it is to get there. I like to be consistent, run real fast times every meet.

"I also have a lot to prove. Last year, I was just out of high school and had a lot of luck. Now, people know me and who I am and they'll be coming after me. That's why it was good to win the first race. Now they're all going to have to chase me. I have a psychological edge."

He also insists that contrary to serveral published reports that appeared last year, he is perfectly content running at Maryland.

"I know a lot has been said about me being unhappy," he said, "but that's all it was: talk. I was really unhappy with what I was doing. I was not adjusted to losing. I never got accustomed to it an high school and I was disappointed with myself last year. But I'm treated very well there and I plan to stay."

Nehemiah also plans to run at Maryland Friday night in the CYO Meet at Cole Field House. "I'm not promising any world records, but yes, I would really like to do well there.

"I just have a lot more confidence in myself this year. I also have a lot more goals I'm looking forward to. I'd like to break my indoor record (he has a world record 7.07 seconds in the indoor 60-yard hurdles) and I think I can get in outdoor record, too. I'm pointing to the outdoor season, but I always want to keep on winning. That's the name of the game."

The Ali meet had one of the world's best times, a 1:01.2 clocking, in the 500-meter dash by Herman Frazier of the Philadelphia Poineer Club at a distance not frequently run on the indoor circuit. Frazier also will compete in the CYO meet.