diff --git a/memcache.inc b/memcache.inc
index 3b5520d..4e11a3b 100644
--- a/memcache.inc
+++ b/memcache.inc
@@ -96,7 +96,8 @@ class MemCacheDrupal implements DrupalCacheInterface {
     if ($cache) {
       $cache_tables = isset($_SESSION['cache_flush']) ? $_SESSION['cache_flush'] : NULL;
       // Items that have expired are invalid.
-      if (isset($cache->expire) && $cache->expire !== CACHE_PERMANENT && $cache->expire <= $_SERVER['REQUEST_TIME']) {
+      if (isset($cache->expire) && $cache->expire !== CACHE_PERMANENT
+        && $cache->expire <= $_SERVER['REQUEST_TIME']) {
         // If the memcache_stampede_protection variable is set, allow one
         // process to rebuild the cache entry while serving expired content to
         // the rest. Note that core happily returns expired cache items as valid
@@ -116,23 +117,50 @@ class MemCacheDrupal implements DrupalCacheInterface {
       }
       // Items created before the last full wildcard flush against this bin are
       // invalid.
-      elseif (!isset($cache->created) || $cache->created <= $this->cache_flush) {
+      elseif (!isset($cache->created) || !isset($cache->created_microtime)
+        // Either the created is before the cache_flush time, or the created ==
+        // cache_flush and the created microseconds is less than the
+        // cache_flush microtime.
+        || $cache->created < $this->cache_flush
+        || ($cache->created == $this->cache_flush
+          && $cache->created_microtime < $this->cache_flush_microtime)) {
         $cache = FALSE;
       }
       // Items created before the last content flush on this bin i.e.
       // cache_clear_all() are invalid.
-      elseif ($cache->expire != CACHE_PERMANENT && $cache->created + $this->cache_lifetime <= $this->cache_content_flush) {
+      elseif ($cache->expire != CACHE_PERMANENT
+        // Either the created+lifetime is before the content_flush time, or
+        // the created+lifetime == content_flush and the created microseconds
+        // is less than the content_flush microtime.
+        && ($cache->created + $this->cache_lifetime < $this->cache_content_flush
+          || ($cache->created + $this->cache_lifetime == $this->cache_content_flush
+            && $cache->created_microtime < $this->cache_content_flush_microtime))) {
         $cache = FALSE;
       }
       // Items cached before the cache was last flushed by the current user are
       // invalid.
-      elseif ($cache->expire != CACHE_PERMANENT && is_array($cache_tables) && isset($cache_tables[$this->bin]) && $cache_tables[$this->bin] >= $cache->created) {
+      elseif ($cache->expire != CACHE_PERMANENT && is_array($cache_tables)
+        && isset($cache_tables[$this->bin])
+        // Extract the microtime values from the cache bin counter.
+        && list($microtime, $time) = explode(' ', $cache_tables[$this->bin])
+        // Either the cache table was cleared after the cache object was
+        // created (seconds), or they were created at the same time (seconds)
+        // and the cache-clear's microseconds are higher than the cache.
+        && ($time > $cache->created
+          || ($time == $cache->created
+            && $microtime > $cache->created_microtime))) {
         // Cache item expired, return FALSE.
         $cache = FALSE;
       }
       // Temporary items created before the cache was last flushed by
       // cache_clear_all(NULL, $bin) are invalid.
-      elseif (!empty($cache->temporary) && $cache->created + $this->cache_lifetime <= $this->cache_temporary_flush) {
+      elseif (!empty($cache->temporary)
+        // Either the created+lifetime is before the temporary_flush time, or
+        // the created+lifetime == temporary_flush and the created microseconds
+        // is less than the temporary_flush microtime.
+        && ($cache->created + $this->cache_lifetime < $this->cache_temporary_flush
+          || ($cache->created + $this->cache_lifetime == $this->cache_temporary_flush
+            && $cache->created_microtime < $this->cache_temporary_flush_microtime))) {
         // CACHE_TEMPORARY item expired, return FALSE.
         $cache = FALSE;
       }
@@ -176,14 +204,14 @@ class MemCacheDrupal implements DrupalCacheInterface {
    * Implements DrupalCacheInterface::set().
    */
   public function set($cid, $data, $expire = CACHE_PERMANENT) {
-    $created_microtime = round(microtime(TRUE), 3);
+    list($microtime, $time) = explode(' ', microtime());
 
     // Create new cache object.
     $cache = new stdClass();
     $cache->cid = $cid;
     $cache->data = is_object($data) ? clone $data : $data;
-    $cache->created = REQUEST_TIME;
-    $cache->created_microtime = $created_microtime;
+    $cache->created = $time;
+    $cache->created_microtime = $microtime;
     // Record the previous number of wildcard flushes affecting our cid.
     $cache->flushes = $this->wildcardFlushes($cid);
     if ($expire == CACHE_TEMPORARY) {
@@ -243,8 +271,11 @@ class MemCacheDrupal implements DrupalCacheInterface {
       // retrieving data from this bin, we will compare the cache creation
       // time minus the cache_flush time to the cache_lifetime to determine
       // whether or not the cached item is still valid.
-      $this->cache_content_flush = time();
+      list($microtime, $time) = explode(' ', microtime());
+      $this->cache_content_flush = $time;
+      $this->cache_content_flush_microtime = $microtime;
       $this->variable_set('cache_content_flush_' . $this->bin, $this->cache_content_flush);
+      $this->variable_set('cache_content_flush_microtime_' . $this->bin, $this->cache_content_flush_microtime);
       if (variable_get('cache_lifetime', 0)) {
         // We store the time in the current user's session. We then simulate
         // that the cache was flushed for this user by not returning cached
@@ -255,8 +286,8 @@ class MemCacheDrupal implements DrupalCacheInterface {
         else {
           $cache_bins = array();
         }
-        // Use time() rather than request time here for correctness.
-        $cache_tables[$this->bin] = $this->cache_content_flush;
+        // Use microtime() rather than request time here for correctness.
+        $cache_tables[$this->bin] = $this->cache_content_flush . ' ' . $this->cache_content_flush_microtime;
         $_SESSION['cache_flush'] = $cache_tables;
       }
     }
@@ -269,8 +300,11 @@ class MemCacheDrupal implements DrupalCacheInterface {
       if (!isset($cid)) {
         // Update the timestamp of the last CACHE_TEMPORARY clear. All
         // temporary cache items created before this will be invalidated.
-        $this->cache_temporary_flush = time();
+        list($microtime, $time) = explode(' ', microtime());
+        $this->cache_temporary_flush = $time;
+        $this->cache_temporary_flush_microtime = $microtime;
         $this->variable_set("cache_temporary_flush_$this->bin", $this->cache_temporary_flush);
+        $this->variable_set("cache_temporary_flush_microtime_$this->bin", $this->cache_temporary_flush_microtime);
         // Return early here as we do not want to register a wildcard flush.
         return;
       }
@@ -282,8 +316,11 @@ class MemCacheDrupal implements DrupalCacheInterface {
         // retrieving data from this bin, we will compare the cache creation
         // time minus the cache_flush time to the cache_lifetime to determine
         // whether or not the cached item is still valid.
-        $this->cache_flush = time();
+        list($microtime, $time) = explode(' ', microtime());
+        $this->cache_flush = $time;
+        $this->cache_flush_microtime = $microtime;
         $this->variable_set("cache_flush_$this->bin", $this->cache_flush);
+        $this->variable_set("cache_flush_microtime_$this->bin", $this->cache_flush_microtime);
         $this->flushed = min($this->cache_flush, time() - $this->cache_lifetime);
 
         if ($this->cache_lifetime) {
@@ -423,9 +460,12 @@ class MemCacheDrupal implements DrupalCacheInterface {
         // it ensures the minimum possible number of wildcards are requested
         // along with cache consistency.
         if ($length < $key_length) {
+          list($microtime, $time) = explode(' ', microtime());
           $this->wildcard_flushes[$this->bin] = array();
-          $this->variable_set("cache_flush_$this->bin", time());
-          $this->cache_flush = time();
+          $this->variable_set("cache_flush_$this->bin", $time);
+          $this->variable_set("cache_flush_microtime_$this->bin", $microtime);
+          $this->cache_flush = $time;
+          $this->cache_flush_microtime = $microtime;
         }
         $key = substr($cid, 0, $key_length);
         $this->wildcard_flushes[$this->bin][$key][$length] = $_SERVER['REQUEST_TIME'];
@@ -569,8 +609,11 @@ class MemCacheDrupal implements DrupalCacheInterface {
     $this->invalidate = variable_get('memcache_wildcard_invalidate', MEMCACHE_WILDCARD_INVALIDATE);
     $this->cache_lifetime = variable_get('cache_lifetime', 0);
     $this->cache_flush = variable_get('cache_flush_' . $this->bin);
+    $this->cache_flush_microtime = variable_get('cache_flush_microtime_' . $this->bin);
     $this->cache_content_flush = variable_get('cache_content_flush_' . $this->bin, 0);
+    $this->cache_content_flush_microtime = variable_get('cache_content_flush_microtime_' . $this->bin, 0);
     $this->cache_temporary_flush = variable_get('cache_temporary_flush_' . $this->bin, 0);
+    $this->cache_temporary_flush_microtime = variable_get('cache_temporary_flush_microtime_' . $this->bin, 0);
     $this->flushed = min($this->cache_flush, REQUEST_TIME - $this->cache_lifetime);
   }
 
diff --git a/tests/memcache.test b/tests/memcache.test
index ee65bd1..11f24b5 100644
--- a/tests/memcache.test
+++ b/tests/memcache.test
@@ -35,6 +35,7 @@ class MemcacheTestCase extends DrupalWebTestCase {
     // Setup our own memcache variables here. We can't use variable_set() yet.
     if ($this->default_bin) {
       $conf["cache_flush_$this->default_bin"] = 0;
+      $conf["cache_flush_microtime_$this->default_bin"] = 0;
       $conf["cache_class_$this->default_bin"] = 'MemcacheDrupal';
     }
 
@@ -132,6 +133,7 @@ class MemcacheTestCase extends DrupalWebTestCase {
     if ($this->default_bin) {
       // Save our memcache variables.
       variable_set("cache_flush_$this->default_bin", 0);
+      variable_set("cache_flush_microtime_$this->default_bin", 0);
       variable_set("cache_class_$this->default_bin", 'MemcacheDrupal');
     }
 
diff --git a/tests/memcache6.test b/tests/memcache6.test
index 197b6e9..91ea3fb 100644
--- a/tests/memcache6.test
+++ b/tests/memcache6.test
@@ -116,6 +116,7 @@ class MemCacheSavingCase extends MemcacheTestCase {
   function setUp() {
     parent::setUp();
     variable_set("cache_flush_cache", 0);
+    variable_set("cache_flush_microtime_cache", 0);
   }
 
   /**
@@ -225,6 +226,7 @@ class MemCacheClearCase extends MemcacheTestCase {
    */
   function testClearWildcardFull() {
     variable_set("cache_flush_$this->default_bin", 0);
+    variable_set("cache_flush_microtime_$this->default_bin", 0);
     cache_set('test_cid_clear1', $this->default_value, $this->default_bin);
     cache_set('test_cid_clear2', $this->default_value, $this->default_bin);
     $this->assertTrue($this->checkCacheExists('test_cid_clear1', $this->default_value)
@@ -241,6 +243,7 @@ class MemCacheClearCase extends MemcacheTestCase {
    */
   function testClearCacheLifetime() {
     variable_set("cache_flush_$this->default_bin", 0);
+    variable_set("cache_flush_microtime_$this->default_bin", 0);
     variable_set('cache_lifetime', 600);
 
     // Set a cache item with an expiry.
@@ -295,6 +298,7 @@ class MemCacheClearCase extends MemcacheTestCase {
    */
   function clearCidTest() {
     variable_set("cache_flush_$this->default_bin", 0);
+    variable_set("cache_flush_microtime_$this->default_bin", 0);
     cache_set('test_cid_clear', $this->default_value, $this->default_bin);
 
     $this->assertCacheExists(t('Cache was set for clearing cid.'), $this->default_value, 'test_cid_clear');
@@ -318,6 +322,7 @@ class MemCacheClearCase extends MemcacheTestCase {
    */
   function clearWildcardPrefixTest() {
     variable_set("cache_flush_$this->default_bin", 0);
+    variable_set("cache_flush_microtime_$this->default_bin", 0);
     cache_set('test_cid_clear1', $this->default_value, $this->default_bin);
     cache_set('test_cid_clear2', $this->default_value, $this->default_bin);
     $this->assertTrue($this->checkCacheExists('test_cid_clear1', $this->default_value)
