About this project
Hi, I'm Mats Julian Steffens, a freelance media computer scientist from Buchholz in der Nordheide, Germany.
The idea
With used smartphones and laptops, it always bothered me that there is hardly any way to find out the real battery life. "Battery health" figures say little about how long a device actually lasts in everyday use. My approach used to be tedious: point a camera at the screen, put a wristwatch next to it and wait for the device to die. So I built Draintest – a battery test that simply runs in the browser, no app, no sign-up.
How it works
- Test ID: Every visit gets a sequential number. It lets you find your result again, even after the device has run flat.
- Samples: During the test the browser sends time and battery level to the server every 30 seconds. The last sample before shutdown is the real runtime.
- Battery level: Read via the browser's Battery Status API (Chrome, Edge, Opera, Samsung Internet). Safari and Firefox don't expose it – there only the time is measured.
- Three load profiles: background (normal use), full CPU load via Web Workers on all cores, and a fullscreen video at maximum brightness. A wake lock keeps the display on.
- Estimate: A linear regression over the samples gives the drain in percent per hour – and thus how long a full charge lasts. Periods on the charger are ignored.
- Privacy-friendly: No cookies, no third-party services, everything runs on a server in Germany.
Contact
- My company: MJS Medien (mjs-medien.de)
- My LinkedIn profile
- mats@draintest.io