How do I fix this such that the LED will blink once per second?

void NewDelay (unsigned long mSecondsApx);
void setup()
{
unsigned char *portDDRB;
portDDRB = (unsigned char *) 0x24;
*portDDRB |= 0x20;
}
void loop ()
{
unsigned char *portB;
portB = (unsigned char *) 0x25;
*portB |= 0x20;
NewDelay (100);
*portB &= 0xDF;
NewDelay (100);
}
void NewDelay (unsigned long mSecondsApx)
{
volatile unsigned long i;
unsigned char j;
unsigned long k;
 unsigned long endTime = 100 * mSecondsApx;
for (i = 0; i < endTime; i++)
{
j = 10;
do
{
j = j – i;
k = i/j;
} while (k>0);
}
}

Use one of the timers?

What's a timer, and how would I apply it to this code? Thank you for your help.

sidney5256:
What's a timer, and how would I apply it to this code? Thank you for your help.

Given that you don't know what a timer is, or what the program does, what are you actually trying to accomplish?

Let me guess - you're either a masochist, or a student who has been told not to use any Arduino core functions?

void NewDelay (unsigned long mSecondsApx);
void setup()
{
unsigned char *portDDRB;
portDDRB = (unsigned char *) 0x24;
*portDDRB |= 0x20;
}
void loop ()
{
unsigned char *portB;
portB = (unsigned char *) 0x25;
*portB |= 0x20;
NewDelay (100);
*portB &= 0xDF;
NewDelay (100);
}
void NewDelay (unsigned long mSecondsApx)
{
volatile unsigned long i;
unsigned char j = 0;
unsigned long endTime = 100 * mSecondsApx;
i= 0;
while (j = 0)
{
i++;
if (i = endTime)
{
j = 1;
}
}
}
if (i = endTime)

Ooops