Home

while

While is a versatile word in English that serves primarily as a subordinating conjunction and as part of an adverbial phrase. In its temporal use, it introduces clauses describing actions occurring simultaneously: "She read a book while he cooked." In a concessive or contrastive sense, it connects two ideas where the second contrasts with the first: "While I understand your reasons, I still disagree." The word can also mark duration or appear in phrases like "for a while."

As a noun phrase, "a while" denotes a period of time; for example, "stay for a while"

In computing, while denotes a control flow construct used to repeat a block of code while a

Usage notes: care is needed to avoid ambiguity when "while" contrasts two clauses; in formal writing it

means
to
remain
for
some
time.
The
phrase
is
common
in
informal
speech
and
in
literature.
The
etymology
traces
to
Old
English
hwil,
meaning
a
period
or
the
passing
of
time,
and
has
developed
through
Middle
English
into
its
modern
usage.
condition
holds
true.
A
while
loop
evaluates
its
condition
before
each
iteration,
so
the
body
may
execute
zero
or
more
times.
C-like
languages
use
syntax
such
as
while
(condition)
{
statements;
},
while
Python
uses
"while
condition:"
followed
by
an
indented
block.
Do-while
loops
in
some
languages
perform
the
loop
body
first
and
then
test
the
condition,
ensuring
at
least
one
execution.
is
often
replaced
with
"whereas"
or
rephrased.
In
programming,
improper
termination
can
produce
infinite
loops;
good
practice
includes
updating
the
condition
within
the
loop
or
introducing
a
break
condition.