Unix time

Definition

Two layers of encoding make up Unix time. These can usefully be separated. The first layer encodes a point in time as a scalar real number, and the second encodes that number as a sequence of bits or in another form.

As is standard with UTC, this article labels days using the Gregorian calendar, and counts times within each day in hours, minutes, and seconds. Some of the examples also show International Atomic Time (TAI), another time scheme, which uses the same seconds and is displayed in the same format as UTC, but in which every day is exactly 86 400 s long, gradually losing synchronization with the Earth's rotation at a rate of roughly one second per year.[......]

阅读全文

代码优化是把双刃剑

代码优化的好处多多,但是这并不意味着所有的代码都需要进行优化,有时过度的优化反而适得其反——费时、费力、不讨好。

“现代计算机科学的鼻祖”Donald Knuth曾说过过早的优化是万恶之源,因为:让正确的程序更快,要比让快速的程序正确容易得多

在项目开发中,总是有程序员浪费宝贵的时间去改进那些不需要改进的代码,而没有通过所做的改进增加价值。在对项目进行优化时,究竟哪些地方应该优化,应该如何优化,哪些不应该优化呢?你需要先来了解一下本文所说的这7件事。[......]

阅读全文