Science

Facebook Programmers Seriously Just Invented a New Unit of Time

There's actually a very good reason for it.

by Alasdair Wilkins
Flickr / dkalo

Not content with conquering all social media, acquiring the likes of Instagram and Oculus VR, expanding into local news and consumer tech, and maybe setting the stage for founder Mark Zuckerberg’s presidential run, Facebook has gone ahead and invented its own unit of time.

While that might sound like the next level of tech hubris — we’re here to disrupt time itself, and all that — there’s actually a really good reason why Facebook programmers released the new unit, known as a flick, on their open source page. It’s solving a shockingly fundamental problem in how computer code deals with video, specifically their frame rates.

The flick is defined as 1/705,600,000 seconds, or about 1.42 nanoseconds. Facebook’s announcement — technically done through its subsidiary Oculus VR, though Facebook Open Source tweeted out the news — notes that it is the smallest unit of time larger than a nanosecond, and it’s designed for use in the programming language C++ when dealing with video applications.

“When working creating visual effects for film, television, and other media, it is common to run simulations or other time-integrating processes which subdivide a single frame of time into a fixed, integer number of subdivisions,” the page explains as the motivation for this new unit. “It is handy to be able to accumulate these subdivisions to create exact 1-frame and 1-second intervals, for a variety of reasons.”

That isn’t actually possible to do with a nanosecond, or a billionth of a second, as it won’t divide evenly into common movie frame rates like 1/24, 1/30, 1/48, 1/60, or 1/120 frames per second. This means programs have to deal with decimal approximations of exactly how many nanoseconds go into those frame rates.

And programs don’t like decimals at all. The nature of binary code makes it massively unwieldy to handle even very simple decimals, as it requires splitting the number into a coefficient and an exponent in order to express it properly. What we would write as 0.01, for instance, needs to be written out and stored as (deep breath) 0 01111000 01000111101011100001010 in binary.

Under those circumstances, it’s actually easier and more straightforward to create a new unit of time that will divide evenly into all the common frame rates, which the flick is designed to do. A frame for a 1/24 fps video is 29,400,000 flicks, for instance, while even a ridiculously high frame rate like 1/192,000 fps divides evenly into 3,675 flicks.

The Oculus VR GitHub page has more on the flick, including a how-to for curious programmers wanting to see how to install it for their own C++ uses. So fear not, this isn’t the first indication of a society-wide switch to Facebook Standard Time — just a seriously neat idea to make video and audio applications run more smoothly.