pg_usleep for multisecond delays

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: pg_usleep for multisecond delays
Date: 2023-02-09 20:59:29
Message-ID: 20230209205929.GA720594@nathanxps13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I just found myself carefully counting the zeros in a call to pg_usleep().
Besides getting my eyes checked, perhaps there should be a wrapper called
pg_ssleep() than can be used for multisecond sleeps. Or maybe the
USECS_PER_SEC macro should be used more widely. I attached a patch for the
former approach. I don't have a strong opinion, but I do think it's worth
improving readability a bit here.

Nathan Bossart
Amazon Web Services:

Attachment Content-Type Size
pg_ssleep.patch text/x-diff 8.0 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-02-09 21:02:02 Re: Importing pg_bsd_indent into our source tree
Previous Message Andres Freund 2023-02-09 20:56:05 Re: Minor meson gripe