I just opened up "clocktab.com" on Chrome, the first simple clock I could find by googling "clock," and Chrome's task manager shows it using a full 42 megabytes of memory.
I just opened up "clocktab.com" on Chrome, the first simple clock I could find by googling "clock," and Chrome's task manager shows it using a full 42 megabytes of memory.
I needed space on my phone the other day so I deleted the flashlight app, which turns an LED on and off, recovering 79 megabytes.
Most of the implementational details would appear to be buried in files on engineering workstations at Chinese factories.
I found a calculator teardown at http://electronupdate.blogspot.com.au/2016/08/reverse-engine... a while ago. The author says it's very old but doesn't provide a ballpark (eg, 1990, 1995, 1998, 2003, etc). It does look quite hairy (and possibly not particularly compactly designed?).
I would guess there's a ridiculously simple ALU somewhere in there, but I wonder what else is involved in the specific context of a high-production-volume fixed-functionality design.
I hope to find something similar for a clock at some point.
(I realize there are ways to get this down to probably the sub-1kB level, but I wanted something I could generate reliably on the fly in a shell script, so...)
And by extension, the rather complex set of POSIX exit() semantics: http://pubs.opengroup.org/onlinepubs/000095399/functions/exi...
Using something like musl should save you some bloat, or simply call "return 0;" instead of exit().
This clock sample ( https://github.com/c-smile/sciter-sdk/blob/master/samples/gr... ) is a port of Mozilla's clock : https://codepen.io/anon/pen/vJpqOY
Chrome needs 6 separate processes to run this sample with total memory consumption of 575 Mb.
Screenshot: https://i.imgur.com/09xjyPs.png
[1]: https://archive.org/details/msdos_win2_03
[2]: https://support.microsoft.com/en-us/help/32905/windows-versi... ("512K of memory or greater" for 2.03).
E.g. on DOS, with direct memory access (plus maybe some INT 10h helpers to draw the digits; although Windows clock doesn't draw them) in video mode 13h, you could do this with a .COM program that would be under a kilobyte total in and of itself. If you counted DOS itself, you'd still be under 64k.